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

location awareness redux

David Collins
Advocate
I'm trying to create some GDL objects that use location awareness to point to different subroutines of varying complexity. The script below comes direct from the GDL Cookbook, but I'm not having any luck with it. My SmartObjects are still really dumb.

Question #1: is the script correct the way I have it?
Question #2: what triggers a change? Ctlr+Shft+R doesn't seem to do it.
Question #3: "Check Script" informs me that "Use of real types can result in precision problems." That's as vague as it is disturbing. What is this trying to tell me?

**********************************
!autodist is a distance parameter

!check distance from camera
!KLM are camera position, XYZ are symbol position
dkx = K~ - X~ :IF dkx=0 THEN dkx = 0.001
dly = L~ - Y~
dmz = M~ - Z~

dr = SQR(dkx^2 + dly^2) !plan distance
dd = SQR(dkx^2 + dly^2 + dmz^2) !distance including height
azi = ATN (dly/dkx) !azimuth

IF dr > autodist THEN
GOSUB 100
ENDIF

IF dr < autodist THEN
GOSUB 200
ENDIF
**********************************

Thanks
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
4 REPLIES 4
David Collins
Advocate
David wrote:
Question #1: is the script correct the way I have it? Question #2: what triggers a change? Ctlr+Shft+R doesn't seem to do it.
To answer my own questions, the script is fine as is. Shift+Ctrl+Alt+R is needed to force a complete update and rebuild of the model, which just Ctlr+Shft+R doesn't quite manage. Next I'm going to check and see what happens with Caplock+Macro+Shift+Ctrl+Alt+R.

I'm still curious about the error message, if someone cares to enlighten me.
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
Anonymous
Not applicable
David wrote:
I'm still curious about the error message, if someone cares to enlighten me.
David, about the error message, try this

EPS = 0.0001 ! master script
In your current script replace
if dkx = 0 then ...
by
if abs(dkx) < EPS then ...

Refer to this link for more informations
http://download.graphisoft.com/ftp/techsupport/documentation/developer_docs/BasicLibraryDoc/LibDevGu...

For previous questions, sorry, i don't know.
David Collins
Advocate
Thanks Olivier, I see what's happening now. Thanks also for the link to the GDL technical standards document. Lots of good information there.
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
Anonymous
Not applicable
David wrote:
Thanks Olivier, I see what's happening now. Thanks also for the link to the GDL technical standards document. Lots of good information there.
Yes, as you said, a lot of good stuff there.
Everyone interested with AC, not only GDL, should read it.
Here is the global link
http://download.graphisoft.com/ftp/techsupport/documentation/developer_docs/BasicLibraryDoc/BasicLib...

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!