Autolisp / Vba Question

Discussion in 'AutoCAD' started by Bjorn Olsson, Apr 29, 2004.

  1. Bjorn Olsson

    Bjorn Olsson Guest

    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
     
    Bjorn Olsson, Apr 29, 2004
    #1
  2. Bjorn Olsson

    bob.at Guest

    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
     
    bob.at, Apr 29, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.