Insert multiple blocks?

Discussion in 'AutoCAD' started by VikCAD04, Oct 23, 2004.

  1. VikCAD04

    VikCAD04 Guest

    I'm working on a lisp where it prompts a user on how many blocks it wants in a drawing, and it would insert that many spaced .25 apart.
    How do I insert the multiple blocks?
    Let's say the user wants 10 blocks, so it has to bring them in and space them accordingly. I'm kind of lost here, how do i get it to realize if it has inserted enough or not?

    Thanks,
    Viktor
     
    VikCAD04, Oct 23, 2004
    #1
  2. VikCAD04

    Jeff Mishler Guest

    Something like this.....
    call this little function like so:
    (multi-insert "myblock" 10 pt1); where the 10 is number of blocks and pt1 is
    the insertion point of the first block

    (defun multi-insert (bname num insPt / )
    (repeat num
    (command "-insert" bname insPt 1.0 1.0 0.0)
    (setq insPt (list (+ (car insPt) 0.25);<--this is the spacing in the x
    direction
    (cadr insPt)
    (caddr insPt)
    ))
    )
    )
     
    Jeff Mishler, Oct 23, 2004
    #2
  3. VikCAD04

    Hans Guest

    Hallo Viktor,

    Why don't you consider (command "MINSERT" "MYBLOCK" "pt1" "1" "1" "0" "" num
    space)?

    gtrz
    Hans
     
    Hans, Oct 24, 2004
    #3
  4. VikCAD04

    VikCAD04 Guest

    thanks for replies, i never heard of MINSERT, tried it and works kind of like i want it, now i just need to put it in there. and automatically number the tags, i think i can figure it out.
    thanks again,
    Viktor
     
    VikCAD04, Oct 25, 2004
    #4
  5. VikCAD04

    VikCAD04 Guest

    ok, misinert does not work for me since i have attributes that need to increment on each block.
    So, any other tricks around it?
     
    VikCAD04, Oct 25, 2004
    #5
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.