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

Adjustable Hotspot Help?!

JGoode
Expert
Hi,

I am trying to add a hotspot to be able to adjust the width of my object.

HSID=1
HSID = HSID+1
HOTSPOT 0, 0, blind_length,HSID+1, track_length, 1+128
HSID = HSID+1
HOTSPOT -1, 0, 0, HSID+1, track_length, 3
HSID = HSID+1
HOTSPOT track_length/2, 0, blind_length ,HSID+1, track_length, 2

This is the script.

The problem I am getting is that the dimensions only start changing after I move the hotspot 50% further than the end of the object. Can't seem to work it out.
IF anyone can help THEN it would be much appreciated. The object is coded so that 0, 0 is in the centre of the object. so -track_length/2 is actually accurate to the edge of the object.

Thanks
ArchiCAD 23

Windows 10
4 REPLIES 4
matjashka
Advocate
JGoode,

The problem with your code is that you are placing your hotstpot at track_length/2 but trying to modify track_length parameter.
Make sure that the position of the hotspot actually corresponds with the dimension you're editing.
Matt Krol [LinkedIn]
BHMS Architects and Planners, Chicago
AC 10 ... 26 USA
JGoode
Expert
matjashka wrote:
JGoode,

The problem with your code is that you are placing your hotstpot at track_length/2 but trying to modify track_length parameter.
Make sure that the position of the hotspot actually corresponds with the dimension you're editing.
track_length/2 is on the end point of my object, as I said, 0, 0 is in the centre of the object. I have no issues with the height or depth but I cannot solve the width.
ArchiCAD 23

Windows 10
matjashka
Advocate
I can't say exactly what causes your geometry to fail, so let me give you a simple example that accomplishes what you're trying to do.
Try this sample 2D script and see if this approach would work for you:
hotspot2 0, 0, 1001, half, 1
hotspot2 half, 0, 1002, half, 2
hotspot2 -1, 0, 1003, half, 3

A=half*2 ![edit] you don't really need this line, see below

line2 -A/2, 0, A/2, 0
hotspot2 -A/2, 0
Now, this sample script defines length of line by its half length. To get the overall length updated in the dialog box you may use the following Parameter script:
parameters A=half*2
lock "A"
Now, say you want to alternate between being able to define the length BOTH by "A" and "half", I suggest you program a switch, make your calculations conditional (IF... THEN), and let the user choose. ArchiCAD will not let you alternate between them in a continuous loop.
Matt Krol [LinkedIn]
BHMS Architects and Planners, Chicago
AC 10 ... 26 USA
Anonymous
Not applicable
Hello,

This might work, not tested.

HSID=0
ADD -track_length/2, 0, blind_length
HOTSPOT 0, 0, 0,HSID+1, track_length, 1+128
HOTSPOT -1, 0, 0, HSID+2, track_length, 3
HOTSPOT track_length, 0, 0 ,HSID+3, track_length, 2
DEL 1
HSID=HSID+3