BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

GDL prob with text anchor pt rot and maintain text orient

Erika Epstein
Booster
I am adding some graphical hotspots to some 2D symbols so I can move the text when necessary. I also have 3 options for text orientation horizontal, vertical, and 'smart' (rotates w/sym but mirrors so not seem upside down).

When I have the text orientation options the anchor point of the text no longer is the same as the graphical hotspots. I tried many ADD2 and ROT2 options for the text location textx and texty with no acceptable results.Can someone point me in the right direction?

! graphical hotspots seripting
!!!!!Text ----------------------------------------
PEN txtpen
IF tr=1 THEN !HORIZONTAL TEXT
ROT2 -symb_rotangle
ENDIF

IF tr=2 THEN ! VERTICLE TEXT
ROT2 -symb_rotangle+90
ENDIF

IF tr=3 THEN !SMART ORIENTATION
mul2 1-2*symb_mirrored,1
IF symb_rotangle>90 AND symb_rotangle<270 THEN
ROT2 180
ELSE
ROT2 0
ENDIF
ENDIF


DEFINE STYLE "symtextstyle" font, 1/(2.83464567)*fontsz, txtanchor, txtFaceCode
SET STYLE "symtextstyle"
TEXT2 textx,texty , switch_text
DEL 1
Erika
Architect, Consultant
MacBook Pro Retina, 15-inch Yosemite 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3
Mac OSX 10.11.1
AC5-18
Onuma System

"Implementing Successful Building Information Modeling"
29 REPLIES 29
Erika Epstein
Booster
Paulo,
When I look at the 2D script in your object their is at the end of some of the numbers E-014. What is this?

line2 -0.03182522174242, -0.04636247205929, 0.03182522174242, 0.04636247205929
line2 -0.2759849876579, -5.684341886081E-014, 0.2793487716144, -5.684341886081E-014
arc2 -0.09936532665787, -5.684341886081E-014, 0.08192157583591, 100.5325984305, 325.5325984304
arc2 0.09936532665787, -5.684341886081E-014, 0.08192157583591, 280.5325984305, 145.5325984304
Erika
Architect, Consultant
MacBook Pro Retina, 15-inch Yosemite 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3
Mac OSX 10.11.1
AC5-18
Onuma System

"Implementing Successful Building Information Modeling"
Anonymous
Not applicable
Hi Erika,

Those weird codes are produced by the ArchiCAD engine...

They appear in the code because I used 2d lines and arcs, and saved them as an object, then copy/pasted them into your object 2d script...

Its a quicker process... once it was just a "Crash test dummy"

I think... When a number like this appears with this code, it's because the ArchiCAD engine avoids coincident nodes in lines and surfaces...
So the engine creates very very small gaps between them to prevent the engine gets crazy... or something like this.

But its just a guess...
David Maudlin
Virtuoso
Erika:

I believe that is scientific notation that indicates that the decimal point is 14 places to the right (the number is actually decimal point, a bunch of zeros, the number before the E-14), such as -0.00000000000005684341886081.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
I did some testing on the four lines of code that Erika posted
and it seems that E-014 is equivalent to +5.684341886081 meters.

Here is the test code:

line2 -0.03182522174242, -0.04636247205929, 0.03182522174242, 0.04636247205929
!!!!line2 -0.2759849876579, -5.684341886081E-014, 0.2793487716144, -5.684341886081E-014
line2 -0.2759849876579, -5.684341886081+5.684341886081, 0.2793487716144, -5.684341886081+5.684341886081
!!!!arc2 -0.09936532665787, -5.684341886081E-014, 0.08192157583591, 100.5325984305, 325.5325984304
arc2 -0.09936532665787, -5.684341886081+5.684341886081, 0.08192157583591, 100.5325984305, 325.5325984304
!!!!arc2 0.09936532665787, -5.684341886081E-014, 0.08192157583591, 280.5325984305, 145.5325984304
arc2 0.09936532665787, -5.684341886081+5.684341886081, 0.08192157583591, 280.5325984305, 145.5325984304

-5.684341886081+5.684341886081 of course
equals zero which is what the autoscripted value should have been.

I believe E-014 has something to do with logarithms and exponents.
In the GDL manual under Transcendental Functions there is a function
EXP (x) that is defined as "Returns the xth power of e (e=2.7182818)"

Peter Devlin
Anonymous
Not applicable
Perhaps the ArchiCAD code is becoming so complex that its developing some kind of artificial intelligence with a stubborn personality...

so its becoming hard for him/it to admit that zero is zero... "NO!... zero is -5.684341886081E-014"

Erika Epstein
Booster
Thanks for everyone's help and explanations.

What still puzzles me is why AC is turning these numbers into Exponentials . Is this typical autoscripting in metric AC? I am unable to reproduce these results when I drag and drop the line-work into a 2D script window; I get just the feet and inches as drawn.

LINE2 0'-0.0000", -0'-6.0000", 0'-0.0000", 0'-6.0000"
Erika
Architect, Consultant
MacBook Pro Retina, 15-inch Yosemite 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3
Mac OSX 10.11.1
AC5-18
Onuma System

"Implementing Successful Building Information Modeling"
Anonymous
Not applicable
Hello Erika,
I just did an experiment where I set the Working Units & Levels
to Meters then drew a couple of lines one meter long. I then opened
a new library part and dragged and dropped the lines into the 2D
script. The code was in Meters. I then changed the Working Units & Levels
to Feet and Fractional Inches and dragged the same lines into the same
2D script. The code for these lines was in Feet and decimal inches.
So, it seems the units in an auto-scripted object depends on the
units used in the project.
Peter Devlin
Erika Epstein
Booster
Peter,
I reproduced what you did, setting it on millimeters and then meters and then feet & inches. I didn't get any numbers with exponents, did you?
Erika
Architect, Consultant
MacBook Pro Retina, 15-inch Yosemite 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3
Mac OSX 10.11.1
AC5-18
Onuma System

"Implementing Successful Building Information Modeling"
Anonymous
Not applicable
Hello Erika,
I'm sorry. I thought you were talking about the units being used
in the script. I did not get values with exponents. I don't think
you will be able to reproduce the code that Paulo got when
he invoked the auto-script mechanism. The auto-script mechanism
gets more screwy in every AC version. I was thinking of asking
Paulo how exactly did he draw the arcs and lines thinking that
maybe he drew them some five Meters below the origin then
dragged them up to the origin before dragging and dropping them
into the 2D script but decided that that should not cause the
strange code. Maybe Paulo can tell us how he managed to get
the auto-script mechanism to write such screwy code.
Thanks,
Peter Devlin
Erika Epstein
Booster
Peter, nothing for you to be sorry about. As always I am learning a lot more than I could have anticipated.
I tried moving the lines I drew 463 miles away from the origin to get the exponents to kick in, but perhaps not far enough.

(in millimeters)
LINE2 746274.7836314, 560996.1281125, 746275.0884134, 560996.1281125

I don't know what the period in the middle of each x and y coordinate signifies.
Erika
Architect, Consultant
MacBook Pro Retina, 15-inch Yosemite 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3
Mac OSX 10.11.1
AC5-18
Onuma System

"Implementing Successful Building Information Modeling"
Learn and get certified!

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!