Clone a Block and Extract Block DB

Discussion in 'AutoCAD' started by Cristian Leon, Nov 5, 2004.

  1. Hi everyone:

    I've got two ideas with blocks... one is to clone a block, it means to take a block and copy within the drawing with other name (for some reasons i need to copy blocks) is there any way?

    The other idea is to get the data base of any block.. not only the attribute data... it's all the lines, polylines, texts, attributes, circles, etc that compound a block and get that code for a future "entmake".

    Can someone help?

    Thanks

    Cristian Leon
    Chile
     
    Cristian Leon, Nov 5, 2004
    #1
  2. Search via google for CloneBlock and an Author of
    John Uhden.

    As for grabbing all of the entities that define a block,
    one way would be to step through the block with the
    (entnext) function and place each ename into a list.
    Once you have all the enames you could do something
    like this...

    (entmake '((0 . "Block)............))

    (foreach item <list of enames>
    (entmake (entget item)) )

    (entmake '((0 . "Endblk")........))

    All "code" typed on the fly..... no checkin'


    --
    Autodesk Discussion Group Facilitator



    take a block and copy within the drawing with other name (for some reasons i
    need to copy blocks) is there any way?
    attribute data... it's all the lines, polylines, texts, attributes, circles,
    etc that compound a block and get that code for a future "entmake".
     
    Jason Piercey, Nov 5, 2004
    #2
  3. Cristian Leon

    Jürg Menzi Guest

    Hi Cristian

    Visit my homepage -> Free Stuff and search for 'VxCloneBlockRef'.

    Cheers
     
    Jürg Menzi, Nov 5, 2004
    #3
  4. Cristian Leon

    James Allen Guest

    Hi Cristian, it can be done (I think) with autolisp (entget, entnext,
    tblobjname, etc.), but I think vlisp would be better for something like
    this. You can get the data by looping through the block definition's
    collection, and then make another block with copy-objects. If you are
    interested, I posted a routine called rcb1 here (
    http://discussion.autodesk.com/thread.jspa?messageID=4107443 ) that may
    help. It is just rough code but includes what you are talking about and
    could be pared down and cleaned up to suit your needs.
    --
    James Allen, EIT
    Malicoat-Winslow Engineers, P.C.
    Columbia, MO


    take a block and copy within the drawing with other name (for some reasons i
    need to copy blocks) is there any way?
    attribute data... it's all the lines, polylines, texts, attributes, circles,
    etc that compound a block and get that code for a future "entmake".
     
    James Allen, Nov 5, 2004
    #4
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.