How to with Block list.

Discussion in 'AutoCAD' started by Steven D. Papke, Jul 18, 2003.

  1. If I wanted to make an instance of an existing block in the drawing say,
    door to door_01, how does one go about accessing this information?
    Or moverover, how does one concatenate the _01 on the end of an existing
    name in the file?
     
    Steven D. Papke, Jul 18, 2003
    #1
  2. This is where I am going with this.

    (prompt "\nSelect source block: ") ; Select Source Block
    (setq bkpic (entsel))
    (setq bkpicmod (car bkpic))
    (setq bknam (cdr (assoc 2 (entget bkpicmod)))) ; Find out blockname
    (setq bknamins bknam)
    (setq bknamins (entmod bknam "_01"))

    I want to make a copy of the existing block and rename it to include _01
    prior to the extension.
    Any insight?
     
    Steven D. Papke, Jul 18, 2003
    #2
  3. Steven D. Papke

    Mark Guest

    maybe
    (entmod (strcat bknam "_01"))
    but first make sure it does not exist
     
    Mark, Jul 18, 2003
    #3
  4. Steven D. Papke

    Mark Guest

    sorry, i meant
    (setq entlist (entget bkpicmod))
    (entmod (subst (cons 2 (strcat bknam "_01")))(assoc 2 entlist) entlist))
     
    Mark, Jul 18, 2003
    #4
  5. Thanks for your help Joe and Mark.
     
    Steven D. Papke, Jul 18, 2003
    #5
  6. Thanks Alex. this is pretty cool as well.
     
    Steven D. Papke, Jul 18, 2003
    #6
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.