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

0 Members and 1 Guest are viewing this topic.

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
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
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

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
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.
Bernd

MP

  • Seagull
  • Posts: 17493
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)
   
)    
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
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
Bernd

MP

  • Seagull
  • Posts: 17493
Changing entities in Blocks
« Reply #5 on: August 09, 2005, 04:29:24 PM »
My pleasure A'dammed.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox