The Global Archicad Community

Stay informed. Get help. Share your knowledge.

Topics specific to the scripting and development of Library Parts and Libraries using Param-O or the Geometric Description Language – GDL. (Example: How do you use “REQUEST” GDL commands?)

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, Gordana Radonic, nbalogh, mnguyen, gkmethy, rmasaki, Akos Somorjai, Csilla Mai, Peter Baksa

By A. Smith
#321006
If an object (a simple cube) has an offset (for example, half of its height above origin) when I click to move it (but have it done yet) the surrounding box of an object is displayed incorrectly.

3D script
Code: Select all
addz zzyzx/2

hotspot 0,0, zzyzx
hotspot 0,0, 0
hotspot a,0, zzyzx
hotspot a,0, 0
hotspot 0,b, zzyzx
hotspot 0,b, 0
hotspot a,b, zzyzx
hotspot a,b, 0

block a, b, zzyzx

del 1

p.s. how can I rid of hotspots below the object (show2Dhotspotsin3D is disabled, same as other options in details - around symbol and so on)
Attachments
boxAroundObject.png
boxAroundObject.png (23.87 KiB) Viewed 210 times
User avatar
By Barry Kelly
#321008
You have turned off 'Show2Dhotspotsin3D' in the object parameters, but don't forget that it is a hidden parameter.
You probably placed your test object before you changed and re-saved the object.
So the originally placed object will still have this option on, and you can't see it to turn it off.

Un-hide the parameter and re-save the object or place a new instance of the object.


Barry.
By A. Smith
#321009
You're right. The object I have placed had an old value of show2DhotpostsIn3D. Thank you.

Maybe you have an idea of how to make the surrounding box to be displayed properly? :D
If you look at the attached image - the distance is 0 (red box), but the contour of an object doesn't match the real contour of an object. Is there a possibility to control it? To make it move - I mean on the same offset I did in 3D script. Or even more - to make it bigger or smaller than an object...
User avatar
By Barry Kelly
#321011
A. Smith wrote: Tue Jan 12, 2021 9:11 am Maybe you have an idea of how to make the surrounding box to be displayed properly? :D
If you look at the attached image - the distance is 0 (red box), but the contour of an object doesn't match the real contour of an object. Is there a possibility to control it? To make it move - I mean on the same offset I did in 3D script. Or even more - to make it bigger or smaller than an object...

I am a little lost as to what you are trying to do.
The very first line of your script is moving the object vertically by half the height of the object.
So the base of your object (its zero base height) is still the project zero - hence the bounding box is starting at project zero.

You also need to adjust the parameters for 'ac_bottomlevel' and 'ac_toplevel' to move this bounding box.
You will need something like this in the master or parameter script.
Code: Select all
ac_bottomlevel = ZZYZX*0.5
PARAMETERS ac_bottomlevel = ac_bottomlevel

ac_toplevel = ac_bottomlevel + ZZYZX
PARAMETERS ac_toplevel = ac_toplevel

Barry.
By A. Smith
#321018
Thank you kindly. That's exactly what I was looking for.
Tbh I'd already tried that and it didn't work. First I started to think (after adding code to master script) that it still has no influence. BUT for a new instance of an object, it's working perfectly fine - your tip for show2DhotspotsIn3D worked here too. :)

Have a good day.
User avatar
By Barry Kelly
#321056
If you un-hide those parameters, the user can change them in the object instance and then the existing object will change to suit.
It is just when they are hidden, they keep the values that were set when you placed the object and there is no way for the user to change them.
Altering the parameter value in the object editor, will not change the parameter value of already placed objects.


Barry.