GDL
About building parametric objects with GDL.

GDL object with parametric label

rodlee94
Beginner

I am creating an object using GDL and I would like to know if there is a way for me to insert a label in 2D with text linked to the material used in the object.

For example, if I insert the concrete material into the object, the label automatically updates and shows the "concrete" 2D text.
Is there a way to do this via GDL?

 

Thank you in advance

4 REPLIES 4
MetalFingerz
Advocate

@rodlee94 , yes it's possible. You would need to request the name of the material and use it with the text2 command.

So if you select your concrete material from a parameter named "materialParam" for example it would go like this :

n = request("Name_of_material", materialParam, name)
x = 0
y = 0

if n > 0 then
	text2 x, y, name
endif

 

The request retrieves the name of the material in a variable called "name". If it can't retrieve anything then "n" is equal to 0 hence the if condition wrapping the text2. Then you can use the text2 command to display it in plan view with coordinates that you can set up the way you want.

Can I ask a question about "Name of material", the manual said it does not compatible with ac

20 above??

Snipaste_2023-10-05_13-31-11.png

That is if you try to request the name of the material in the parameter or master scripts.

But if you request it in the 2D or 3D scripts, it should be fine.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Funfun Yan
Enthusiast

I see, thank you!😀