creating new parameters with FOR NEXT loop?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2013-07-18 11:28 AM
‎2013-07-18
11:28 AM
I'm trying to create rectangular symbol and give movable hotspot for each rect.
My code looks like this:
!-------------------------------------------------------------------------
nRect = 3
unID = 100
for i = 1 to nRect
add2 1.5, 0
hotspot2 0, moveY, unID, moveX, 1+128 :unID = unID+1 ! Move X
hotspot2 moveX, moveY, unID, moveX, 2+256 :unID = unID+1
hotspot2 -1, moveY, unID, moveX, 3 :unID = unID+1
hotspot2 moveX, 0, unID, moveY, 1+128 :unID = unID+1 ! Move Y
hotspot2 moveX, moveY, unID, moveY, 2+256 :unID = unID+1
hotspot2 moveX, -1, unID, moveY, 3 :unID = unID+1
add2 moveX, moveY
rect2 -A/2, -B/2, A/2, B/2
del 1
next i
del nRect
!-------------------------------------------------------------------------
What I aim for is that, each hotspot can move each rect attached to it freely, not all at the same time. Right now I can create new parameters like "moveX1" , "moveY1", ... and use them for each rect (using subroutine)....something like :
if nRect = 1 then gosub "rect1"
if nRect = 2 then gosub "rect2"
Then I realize, if I want nRect to be 20, I will have to create 40 more parameters.
Is there a smarter way, something that works like unID=unID+1, maybe? Any comment is appreciated.
Archicad 26, Windows 10, Corei7 3.4 GHz, 16 GB Ram.
https://www.indigofigs.com
https://www.facebook.com/indigofigs
https://www.indigofigs.com
https://www.facebook.com/indigofigs
2 REPLIES 2
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2013-07-18 01:44 PM
‎2013-07-18
01:44 PM
Hi Palawat,
you have to use arrays for moveX/moveY.
The unID is right.
you have to use arrays for moveX/moveY.
The unID is right.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2013-07-18 03:43 PM
‎2013-07-18
03:43 PM
Thank you very much, ila2.
I'll look into it.
I'll look into it.

Archicad 26, Windows 10, Corei7 3.4 GHz, 16 GB Ram.
https://www.indigofigs.com
https://www.facebook.com/indigofigs
https://www.indigofigs.com
https://www.facebook.com/indigofigs