As you can see above I am trying to make script working like this:
-when I click on already made line , script will make rectangle modified as on picture.
same would go for curve or spineline
script would take lenght from line and made same lenght rectangle, width would always be 80mm
-then it will add 5mm to top and bottom
-and 10mm for the sides
How do you want to define the rectangle relative to the curve? Are you looking for an axis-aligned box, some sort of expansion of a minimum XY bounding box, or some other type of alignment?
Rectangle could have start point at 0,0,0 even(something like _squish). Main dimension would be line lenght. I dont know C or any othe programing language to do it. I dodnt know even how to start it.
Command that reads the line lenght would be helpful.
Thank you for contact and sorry for delayed answer
Ah, so you’re not looking for something that actually encloses the line, just a rectangle 90mm high based on the curve’s length + 20mm, is that it? That’s fairly simple to do.
Instead of hard-coding your offset values, I set up user choices with them as defaults, you can change them if you like. Any changes will stick between uses in the same session. It will create rectangles for as many curves as you like at one time, and stack them vertically along the Y axis with a user set space between them. The rectangles and the corresponding original curves are marked and grouped with text dots so you know which ones correspond.
Spacing only changes the spacing of the layout between successive rectangles (if you input more than one curve), does not affect the rectangles themselves. Seems to work here.
The “Length margin” is how much to add to overall length of the curve to get the length
The Height is the total height of each rectangle - it’s not an additional factor
Were you expecting it to do something different? The script can be adjusted…