Autolisp / Vba Question

Am trying to create a little command that will measure a length of line, say the side of a house, then insert blocks along it.
As well as that, i would like it to choose wich blocks to fit best, as have some of varying lengths, to satifactorial be close to the length of the original line.
for example, the line is 2400 long. i have blocks that are 500 and 200 long. i want it to arrange them so it uses four at 500 and two at 200.
How difficult is it to write such a routine? Have written basic routines, but this ones still eludes me :(
Cheers
Bjorn
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Hello Bjorn, i think the principl program should not be very hard: 1.) select line 2.) get length and angle of line 3.) decide which blocks to use and store it in a list (b200 b500 b500 b500 b500 b200) 4.) calc first insert point 5.) foreach block in list: insert block, calc next insertpoint
More difficult it will be to decide, which blocks you want to use, espacially when you have "unround" values (i.g 2173, and not 2400) as length. For that its maybe the best to start at the midpoint of line, insert the biggist block that is possible and than step to the endpoint. Makeing this list should be an own function which returns the complet list and wich is called in step 3.) form above. Then its easy to test some different ways of creating the list.
Maybe you try this, and if you have specific problems you're welcomed here
bob.at

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.