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

Moveable Hotspot Error

Anonymous
Not applicable
Hi everybody, Happy Holidays!!

We use a very basic marker for doors in plan. To create the most basic I saved Archicad11 door script as my own and made some changes. My utmost concern was keeping the text readable regardless of the SYMB_ROTANGLE and WALL_DIRECTION. Once I accomplished this I couldn't leave well enough alone!! In some situations we need to move the text to a different spot so I added the "Movable Hotspot". I've used this before and never had a problem. In the case of this door though I keep getting these "Duplicate unID" warnings. This object seems to work fine but I can't stand the fact that I'm getting these warnings. I've attached a screen shot of the warnings and the script I added is below. The text statements at the end of the script were used to figure out in which situations I needed to rotate the text to my liking. (by the way, I have a feeling that the script I wrote could be done more efficiently. If so please let me know). Any insight would be appreciated.

Doug

IF WALL_DIRECTION >90 AND WALL_DIRECTION<270 AND SYMB_ROTANGLE=0 THEN
ROT2 180
ADD2 0, WALL_THICKNESS
ENDIF
IF WALL_DIRECTION <90 AND SYMB_ROTANGLE=180 THEN
ROT2 180
ADD2 0, WALL_THICKNESS
ENDIF
IF WALL_DIRECTION>270 AND SYMB_ROTANGLE=180 THEN
ROT2 180
ADD2 0, WALL_THICKNESS
ENDIF
verti=verti + 2 1/2" - WALL_THICKNESS/2
unID=1
!_________________________moving it horizontally
hotspot2 0,verti,unID,horz,1+128 : unID=unID+1
hotspot2 -1,verti,unID,horz,3 : unID=unID+1
hotspot2 horz,verti,unID,horz,2+256 : unID=unID+1

!_________________________moving it vertically
hotspot2 horz,0,unID,verti,1+128 : unID=unID+1
hotspot2 horz,-1,unID,verti,3 : unID=unID+1
hotspot2 horz,verti,unID,verti,2+256 : unID=unID+1

define style 'covtext' arial,1.75,2,0
set style 'covtext'
text2 horz,verti,FPT
PEN 121
TEXT2 0,6",SYMB_ROTANGLE
PEN 126
TEXT2 0,16",STR("%0.16FFI",WALL_THICKNESS)
PEN 125
TEXT2 0,26",WALL_DIRECTION
END

Duplicate unID's.PNG
12 REPLIES 12
vistasp
Advisor
Karl wrote:
To clarify: the uniqueness of hotspot ID's is an issue only within a single placed object. There can only be one hotspot "1" in any particular object. But, all objects can have a hotspot "1".

However, when an object calls macros, those macros are in essence part of the same object... they are all interpreted in order to generated the representation of the object. So, all hotspots across all called macros must be unique.
Thanks for that explanation Karl. That makes a lot more sense.

Re: the unID = 12345 + unID statement, I misread it the first time and assumed the unID was being initialised at 12345. My mistake.
= v i s t a s p =
bT Square Peg
https://archicadstuff.blogspot.com
https://www.btsquarepeg.com
| AC 9-27 INT | Win11 | Ryzen 5700 | 32 GB | RTX 3050 |
vistasp
Advisor
Peter wrote:
So, it seems that even though, you write an editable hotspot, that contains a duplicate ID, it does not cause a runtime error and the 2D script runs without error.
Could it be that the 2D script works but the hotspots aren't editable?
= v i s t a s p =
bT Square Peg
https://archicadstuff.blogspot.com
https://www.btsquarepeg.com
| AC 9-27 INT | Win11 | Ryzen 5700 | 32 GB | RTX 3050 |
David Maudlin
Rockstar
Peter:

If you change your script to:
Pen 10
hotspot2 0,0
hotspot2 0,0
circle2 0,0,1"

You will not get the error message, because for the non-editable hotspots, the unID is optional. For the editable hotspots, the unID is required.

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