Adjustable Hotspot Help?!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2017-05-24 04:43 PM
2017-05-24
04:43 PM
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
Windows 10
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2017-05-24 05:16 PM
2017-05-24
05:16 PM
JGoode,
The problem with your code is that you are placing your hotstpot attrack_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.
The problem with your code is that you are placing your hotstpot at
Make sure that the position of the hotspot actually corresponds with the dimension you're editing.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2017-05-24 05:18 PM
2017-05-24
05:18 PM
matjashka wrote: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.
JGoode,
The problem with your code is that you are placing your hotstpot attrack_length/2but trying to modify track_lengthparameter.
Make sure that the position of the hotspot actually corresponds with the dimension you're editing.
ArchiCAD 23
Windows 10
Windows 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2017-05-24 07:47 PM
2017-05-24
07:47 PM
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:
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, 0Now, 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.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2017-05-24 08:00 PM
2017-05-24
08:00 PM
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
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