Got a minute? We appreciate your feedback:

Graphisoft Learn survey
GDL
About building parametric objects with GDL.

GDL SCRIPTING show home elevation in text in 2d

Tezak
Contributor

I´m trying to build an electricity socket that is 3D modelled but in floor plan it only shows a 2D symbol with a editable text (for the circuit) and an autotext for its elevation to home stroy. 

 

The idea is, circuit goes above (and it´s a manual input)
Height goes below (it´s basically a height from home story or bottom level maybe)


that´s the parameter for circuitthat´s the parameter for circuitcircuit goes above, height from home story goes belowcircuit goes above, height from home story goes below

 

This is what I have in the 2D script, I just need to know how to call the height in meters please.

 

paragraph "AC_PRG_13" 1, 0, 0, 0, 1
pen penAttribute_4
set style "AC_STYLE_1"
circuit
endparagraph
paragraph "AC_PRG_14" 1, 0, 0, 0, 1
set style "AC_STYLE_2"
"h:"
"1.2"
" m"
endparagraph

1 ACCEPTED SOLUTION
7 REPLIES 7

Lingwisyer
Hero

I would script this type of object so that it's origin is at your floor level, in which case you would use zzyzx to offset the object vertically. This value can then be inserted as a parameter where required.

 

If you are not doing that, you could use

GLOB_ELEVATION - GLOB_HSTORY_ELEV

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 

Thanks but I tried with GLOB_ELEVATION - GLOB_HSTORY_ELEV and Archicad returns a "string type expression required in line...."

On the other case, how do you set a floor level origin in that case?

Lingwisyer
Hero

Oh true. Cannot use Autotext in calculations. You would need to use a Request to get usable values... 

 

n = REQUEST ("Story_info", expr, nStories,
index1, name1, elev1, height1 [,
index2, name2, ...])

 

 

Corrected by Barry. Getting myself confused between globals and autotexts... even though globals are clearly denoted...

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 

Solution

Yes, because that is a number and you are using a string in your paragraph.

You can't mix numbers and string values in text.

 

You need to convert the number to a string ... STR("%m", GLOB_ELEVATION - GLOB_HSTORY_ELEV)

I think that is the correct syntax to convert to a meter value.

Something like that anyway.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

-

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 

No, they are GLOBAL variables.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Thanks a lot, It worked! 

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!