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

Smart Hotspots

Red
Advocate
I'm looking for a tutorial/info on how to script 2d smart hotspots. Does anyone know where I could find one?
Thanks,
Red
i7 8700k
ROG Strix Z390-E MoBo
64gb RAM
EVGA GeForce GTX 2080
_______________________
http://www.facebook.com/flatcreekdesignstn
http://www.sraarchitects.biz
27 REPLIES 27
Anonymous
Not applicable
Olivier wrote:
Barry, you can move the 3D hotspot in xyz dimensions, but only two palettes of coordinates will show.

Look at this example, Tentmaker_1.gsm, the interface allows to choose z or xy or xyz coordinates for 3D hotspots.
http://archicad-talk.graphisoft.com/viewtopic.php?t=3183

Unfortunatelly with xyz, the control is not easy, because the shift key does not work as expected with z axis.
The hotspot feature needs some improvement.
It is inevitable that any new feature leaves room for improvement. There has also always been some inconsistency with moving/stretching in the z direction. The relative r (type r and enter distance) does not work on the z axis, it only accepts values as relative to project zero (maybe it works with the user origin too - I haven't tried that) and not the element's origin nor the current (command) origin.

I have found that constraining the movable hotspot in the z direction works quite well though.
Karl Ottenstein
Moderator
Barry wrote:
!Stretchy x
HOTSPOT 0, dist_y, dist_z, unID, dist_x, 1+128	!base
HOTSPOT -1, dist_y, dist_z, unID, dist_x, 3		!reference
HOTSPOT dist_x, dist_y, dist_z, unID, dist_x, 2	!moveable
unID=unID+1
I don't know if it matters in your case, but we had a bit of confusion over the hotspot ID issue when editable hotspots were introduced - discussion archived in GDL-talk I think. Note that the GDL reference manual and Graphisoft indicate that each hotspot command should have a unique ID, not the group of hotstpots as you show (and as I also misunderstood when this feature was introduced).

So your code should read:
!Stretchy x
HOTSPOT 0, dist_y, dist_z, unID, dist_x, 1+128	!base
unID=unID+1
HOTSPOT -1, dist_y, dist_z, unID, dist_x, 3		!reference
unID=unID+1
HOTSPOT dist_x, dist_y, dist_z, unID, dist_x, 2	!moveable
unID=unID+1
HTH,
Karl
One of the forum moderators
AC 28 USA and earlier   •   macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Anonymous
Not applicable
Karl wrote:
Note that the GDL reference manual and Graphisoft indicate that each hotspot command should have a unique ID, not the group of hotstpots as you show
Karl you are right. May i add that GS recommends always to declare the first unID (unID=1 or 1000 or more) depending if you call macros.

About calling macros, i get better results when i script all the hotspots in the final object, not by calling macro's hotspots.
I have several examples, but this is only my point of view.

To come back to Barry's post, if i want to move the hotspot in the 3D window,
If i declare x, i can constrain the hotspot in x direction
If i declare y, i can constrain the hotspot in y direction
If i declare z, i can constrain the hotspot in z direction
If i declare xy, i can constrain the hotspot in x and y directions
If i declare xz, i can constrain the hotspot in x direction only, i can move it on z, but without control
If i declare yz, i can constrain the hotspot in y direction only, i can move it on z, but without control
If i declare xyz, i can constrain the hotspot in x and y directions, i can move it on z, but without control

If you get different results, please tell me, i will be glad to learn.
I would like three palettes of coordinates when i declare xyz, and the ability to constrain the z direction.
Smart hotspots are one of the best features of AC8, but sorry to insist, they need some improvements.
Barry Kelly
Moderator
Karl wrote:

I don't know if it matters in your case, but we had a bit of confusion over the hotspot ID issue when editable hotspots were introduced - discussion archived in GDL-talk I think. Note that the GDL reference manual and Graphisoft indicate that each hotspot command should have a unique ID, not the group of hotstpots as you show (and as I also misunderstood when this feature was introduced).

So your code should read:
!Stretchy x
HOTSPOT 0, dist_y, dist_z, unID, dist_x, 1+128	!base
unID=unID+1
HOTSPOT -1, dist_y, dist_z, unID, dist_x, 3		!reference
unID=unID+1
HOTSPOT dist_x, dist_y, dist_z, unID, dist_x, 2	!moveable
unID=unID+1
HTH,
Karl

Thanks Karl,
I tried this but it made no difference.

As someone else mentioned (I think on GDL-Talk) that it seems odd to have a unique ID for each part of the hotspot.
Couldn't the program control that automatically?
After all it has unique ID's for all elements in the model and can keep track of those OK.

The GDL help file states "unID: unique identifier, which must be unique among the hotspots defined in the library part. "

I guess it depends on how you look at a graphical hotspot.
Is it 3 or 4 separate hotspots that combine to make one, or is it one hotspot with 3 or 4 lines of code?
If you really think about it they are really 3 or 4 separate hotspots.
The help file examples show unique ID's for each of these separate parts so I guess that is the way to do it.

Seems to make no difference at the moment but who knows what will happen in the future.
If using a single unique ID for a group (one graphical hotspot) is wrong, then why does the GDL editor not say it is bad script?

Could Graphisoft please confirm which way is right or wrong or whether it matters at all?

Minor winge as it takes nothing to add the incremental counter, but why should we need to do it?
More command lines for the program to process.
More nanno-seconds of time wasted waiting.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Barry Kelly
Moderator
Olivier wrote:

To come back to Barry's post, if i want to move the hotspot in the 3D window,
If i declare x, i can constrain the hotspot in x direction
If i declare y, i can constrain the hotspot in y direction
If i declare z, i can constrain the hotspot in z direction
If i declare xy, i can constrain the hotspot in x and y directions
If i declare xz, i can constrain the hotspot in x direction only, i can move it on z, but without control
If i declare yz, i can constrain the hotspot in y direction only, i can move it on z, but without control
If i declare xyz, i can constrain the hotspot in x and y directions, i can move it on z, but without control

If you get different results, please tell me, i will be glad to learn.
I would like three palettes of coordinates when i declare xyz, and the ability to constrain the z direction.
Smart hotspots are one of the best features of AC8, but sorry to insist, they need some improvements.
Olivier,
I can confirm exactly what you get here.
The only way I have been able to get all 3 stretchy directions is to use ZZYZX for the Z variable - not always desirable in an object.

However you still only get 2 co-ordinates in the dialogue box - x and z or y and z.
You can however stretch (constrained with shift key) in both the x and y directions (3rd button on the pet palette that appears) even though you can't see the value for either x or y.
And the 4th button on the pet palette allows you to stretch z (constrained automatically).

Seems to be a bit of a bug here (any comments Graphisoft please?).
Is it any differnt in version 9.0?

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Anonymous
Not applicable
I'm trying to create a new block that's editable in 3d. From what I understand, 3d HOTSPOTS is the answer. However, I seem to have hit upon a baffling problem. If I try to use the sample editable hotspot code provided by Karl...
!Stretchy x
HOTSPOT 0, dist_y, dist_z, unID, dist_x, 1+128   !base
HOTSPOT -1, dist_y, dist_z, unID, dist_x, 3      !reference
HOTSPOT dist_x, dist_y, dist_z, unID, dist_x, 2   !moveable
unID=unID+1
I get an error that dist_x is not a valid parameter name. This appears to be the case whatever variable I use. The reason could be the time of day I'm working on this, but... maybe not. So, anybody have any ideas? This is with AND without increasing the unID for each HOTSPOT.
Stuart Atkinson
Participant
You need to make sure that you have dist_x, dist_y and dist_z in your parameter list.


Cheers
Stu.
Karl Ottenstein
Moderator
Sergio wrote:
I'm trying to create a new block that's editable in 3d. From what I understand, 3d HOTSPOTS is the answer. However, I seem to have hit upon a baffling problem. If I try to use the sample editable hotspot code provided by Karl...
!Stretchy x
HOTSPOT 0, dist_y, dist_z, unID, dist_x, 1+128   !base
HOTSPOT -1, dist_y, dist_z, unID, dist_x, 3      !reference
HOTSPOT dist_x, dist_y, dist_z, unID, dist_x, 2   !moveable
unID=unID+1
I get an error that dist_x is not a valid parameter name. This appears to be the case whatever variable I use. The reason could be the time of day I'm working on this, but... maybe not. So, anybody have any ideas? This is with AND without increasing the unID for each HOTSPOT.
Ayyyy. No, that's the code that I said NOT to use. You must assign a unique ID to each hotspot, so the unID variable must be incremented as in the code samples earlier in this thread. 😉

Does Checkscript give the error, or is it when you try to edit the hotspot?

Take a look at some of the 9.0 library code, for example Cylinder in Basic Shapes 9.

Karl
One of the forum moderators
AC 28 USA and earlier   •   macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Anonymous
Not applicable
Sergio, i got an error when i copy paste your script, illegal < > character at line blablabla.
Search and replace all the spaces by a "W" character.
Look at the empty spaces, just before breakpoints. The "illegal" characters. See below.

HOTSPOTW0,Wdist_y,Wdist_z,WunID,Wdist_x,W1+128 W !baseW
HOTSPOTW-1,Wdist_y,Wdist_z,WunID,Wdist_x,W3 W W W!referenceW
HOTSPOTWdist_x,Wdist_y,Wdist_z,WunID,Wdist_x,W2 W !moveableW
unID=unID+1

Delete all these empty parts, it should work.
This happens sometime after copy paste operations with pdf documents, some space characters are not recognized.

PS: Karl is right, you have to declare the first unID, and then assign a unique ID to each hotspot.
Red
Advocate
Ok!?!?!

What I'm trying to do is multiple (array) as many copies as I need of an 2D object by an interger parameter. Could someone take the following script below and show me how I can do this. Also each copy should have a movable (SMART) hotspot in the middle.

rect2 0,0,2',2'
Also can it multiple them 3' apart?
Thanks,
Red
i7 8700k
ROG Strix Z390-E MoBo
64gb RAM
EVGA GeForce GTX 2080
_______________________
http://www.facebook.com/flatcreekdesignstn
http://www.sraarchitects.biz