Author Topic: Changing entities in Blocks  (Read 2412 times)

0 Members and 1 Guest are viewing this topic.

Amsterdammed

  • Guest
Changing entities in Blocks
« on: August 09, 2005, 03:14:50 PM »
Hello everybody,

For the cleaning up of drawings from Builders I would need to be able to change Entities in Blocks with “subst”, no matter how deep they are in the blocks.

Does anybody have a lisp solution for this problem?

Thanks in advance,

Bernd

daron

  • Guest
Changing entities in Blocks
« Reply #1 on: August 09, 2005, 03:29:15 PM »
Use nentsel. If you're using ADT use the display props dialog.

Amsterdammed

  • Guest
Changing entities in Blocks
« Reply #2 on: August 09, 2005, 03:32:49 PM »
I have no ADT and i need to do a lot of entities in a lot of dwgs, so I must get to the subentities in a different way.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Changing entities in Blocks
« Reply #3 on: August 09, 2005, 03:42:33 PM »
Walk (iterate) and modify the block definitions to suit.

Simplified example:
Code: [Select]
(progn

    (vlax-for block

        (vlax-get-property
            (vlax-get-property
                (vlax-get-acad-object)
               'ActiveDocument
            )
           'Blocks
        )
       
        ;;  force all entities within blocks
        ;;  matching "*" name spec to bylayer

        (if (wcmatch (vlax-get-property block 'Name) "*")
            (vlax-for entity block
                (vlax-put-property
                    entity
                   'Color
                    256
                )
            )    
        )    

    )
   
    (princ)
   
)    
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

Amsterdammed

  • Guest
Changing entities in Blocks
« Reply #4 on: August 09, 2005, 04:24:48 PM »
:D
That's just great MP.

Thank you a lot.

 :D

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Changing entities in Blocks
« Reply #5 on: August 09, 2005, 04:29:24 PM »
My pleasure A'dammed.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst