GDL
About building parametric objects with GDL.
SOLVED!

surrouding box of an object

A_ Smith
Expert
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

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)
AC 22, 24 | Win 10
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Barry Kelly
Moderator
A. wrote:
Maybe you have an idea of how to make the surrounding box to be displayed properly?
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.
ac_bottomlevel = ZZYZX*0.5
PARAMETERS ac_bottomlevel = ac_bottomlevel

ac_toplevel = ac_bottomlevel + ZZYZX
PARAMETERS ac_toplevel = ac_toplevel

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

View solution in original post

5 REPLIES 5
Barry Kelly
Moderator
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.
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
A_ Smith
Expert
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?
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...
AC 22, 24 | Win 10
Solution
Barry Kelly
Moderator
A. wrote:
Maybe you have an idea of how to make the surrounding box to be displayed properly?
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.
ac_bottomlevel = ZZYZX*0.5
PARAMETERS ac_bottomlevel = ac_bottomlevel

ac_toplevel = ac_bottomlevel + ZZYZX
PARAMETERS ac_toplevel = ac_toplevel

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
A_ Smith
Expert
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.
AC 22, 24 | Win 10
Barry Kelly
Moderator
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.
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