GDL
About building parametric objects with GDL.
SOLVED!

GDL Request Textblock Width for Auto Text

ocamorlinga
Booster

I'm messing around with the Change Marker object and need to get the width of the Change ID, so that the width of the frame can change depending on the length of the Change ID string. By using the REQUEST function I am able to get the width of the string, but changing the ID does not change the width of the frame. I'm assuming this is because of the auto text that is grabbing the actual Change ID, which is the string "<CHANGEID>", so the REQUEST function is grabbing the width of the literal string "<CHANGEID>" as opposed to the actual ID.

 

Is there a way to get the length of the auto text after it has been "calculated" so to speak? Or a way to grab the Change ID through a variable or parameter from the object? I don't see any global variables that would point to the ID. Below is the current result of my change marker with two different lengths of IDs.

 

ocamorlinga_0-1665010051100.png

 

Thanks!

AC 24 US
Windows 10, AMD Ryzen 7 3700X, 16.0 GB Ram, AMD Radeon RX 5700 XT
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Palawat
Advocate

I'm afraid you cannot "request" an Autotext. Autotext can be used in GDL but it will just passing through. GDL cannot grab the value of the Autotext so you can't manipulate any of it.

Archicad 26, Windows 10, Corei7 3.4 GHz, 16 GB Ram.
https://www.indigofigs.com
https://www.facebook.com/indigofigs

View solution in original post

6 REPLIES 6
Lingwisyer
Guru

Could you use the LAYOUT_CHANGE_HISTORY global? If there is another string to figure out how many Changes have been made, you might then be able to use it much like you do WALL_SKINS_PARAMS?

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
julienK
Advocate

There is a function in GDL to return the length of a string:

 

STW
STW (string_expression)
Returns the (real) width of the string in millimeters displayed in the current style. The width in meters, at current scale, is STW
(string_expression) / 1000 * GLOB_SCALE.

Solution
Palawat
Advocate

I'm afraid you cannot "request" an Autotext. Autotext can be used in GDL but it will just passing through. GDL cannot grab the value of the Autotext so you can't manipulate any of it.

Archicad 26, Windows 10, Corei7 3.4 GHz, 16 GB Ram.
https://www.indigofigs.com
https://www.facebook.com/indigofigs

I can get a list of all of the change id's from LAYOUT_CHANGE_HISTORY but I can't figure out a way to match the specific marker's change id to that list. If there was only a way to get the information of the marker's linked change other than using the autotext "<CHANGEID>" then we would be good

AC 24 US
Windows 10, AMD Ryzen 7 3700X, 16.0 GB Ram, AMD Radeon RX 5700 XT

I was already able to get the width of the string by using REQUEST("TEXTBLOCK_INFO", ...) but I wasn't aware of the STW function, it's much simpler to use for this case, thanks!

AC 24 US
Windows 10, AMD Ryzen 7 3700X, 16.0 GB Ram, AMD Radeon RX 5700 XT

This is what I was afraid of. If there was only a way to grab the information of the change the marker is linked to then everything would be much simpler, but for now I'll just have to put a "width" parameter a user can change manually. Thanks for your response

AC 24 US
Windows 10, AMD Ryzen 7 3700X, 16.0 GB Ram, AMD Radeon RX 5700 XT