cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum

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

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 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

View solution in original post

7 REPLIES 7

Lingwisyer
Legend

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 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200 RIP PSU
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?

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 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

-

AC22-23 AUS 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200 RIP PSU
Win10 | R5 2600 | 16GB | GTX1660

No, they are GLOBAL variables.

 

Barry.


One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Thanks a lot, It worked! 

Lingwisyer
Legend

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 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200 RIP PSU
Win10 | R5 2600 | 16GB | GTX1660

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!