Hi!
I'm creating a SmartPart that draws a rectangle several times, and this was created from two ways:
- From a handle "A" to copy the rectangle along a length
- From a handle "B" which controls the number of rectangles
In this script, the handle "A" works well, but the handle "B" does not work. How do you write the script correctly? This is the script:
rect_x = 0.5
rect_y = 0.5
n_objects = lenght / rect_x
!---- Handle of distribution of rectangles by total lengh
id = id + 1
HANDLE2 0 , 0 , id , "lenght" , 1
HANDLE2 lenght , 0 , id , "lenght" , 2
HANDLE2 -1 , 0 , id , "lenght" , 3
!---- Handle of distribution of rectangles by number
id = id + 1
HANDLE2 lenght , rect_y , id , "n_objects" , 9
!---- Call Layout
FOR kk = 1 TO n_objects
GOSUB "rectangle"
TRANS2 rect_x , 0
NEXT
RESTORE n_objects
RESTORE 1
END
!---- Subscript
"rectangle":
RECT2 0 , 0 , rect_x , rect_y
RETURN
Thanks a lot!
Xavi
Xavier Coll • Architect, Project Manager I+D, BIM Manager, BIM Auditor
EiPM • http://www.eipm.es/en/