PDA

View Full Version : batch modification of block properties



CBLENDERMANN
2004-08-12, 09:07 PM
Hello,
I am trying to find a routine to change the color setting of all objects in a block to "by layer"
Our block library is in need of an upgrade and it would help to get some of the cleanup done by a batch routine.
For instance, I would like to be able to select all the files in a library folder and change the layers within the blocks to "by layer".
Any ideas or routines on how to achieve that would be welcome.
Thank you in advance for any help.

Cord B.

mjfarrell
2004-08-12, 09:27 PM
How abaout a script that selects all and changes
them to by BYLAYER?

In this way you could batch them.


CHANGE
ALL
Properties
Color
BYLAYER
LT
BYLAYER

Just let that loop through a full list of all your block drawings.

Mike.Perry
2004-08-12, 09:54 PM
Hi

Sorry how does the above script change Objects within Block definitions to ByLayer?

Give the following thread a try for suitable solutions -

Changing block entities' color to bylayer (http://forums.augi.com/showthread.php?t=5547&highlight=Block+Bylayer)

Have a good one, Mike

mjfarrell
2004-08-12, 10:04 PM
For instance, I would like to be able to select all the files in a library folder and change the layers within the blocks to "by layer".

Cord B.


It would do just what he stated he wanted to do.
Open each block drawing in a folder and change all
elements in that block to be bylayer.
I don't see where he says "I want to select all blocks in a drawing
and change their elements to be bylayer".

Mike.Perry
2004-08-12, 10:15 PM
Hi

Sorry I must be reading it totally wrong -


I am trying to find a routine to change the color setting of all objects in a block to "by layer"

For instance, I would like to be able to select all the files in a library folder and change the layers within the blocks to "by layer".
The above to me definitely sounds like Objects within Blocks....

Have a good one, Mike

peter
2004-08-13, 12:49 AM
Use vl -directory-files to get a list of blocks in a directory and run this routine on member of the list.

Peter Jamtgaard



(defun DBX5 (DWGNAME / DBXOBJ DBXFILE DWGNAME LOOBJ OBJ)
(setq DBXOBJ (vla-GetInterfaceObject
(vlax-get-acad-object)
"ObjectDBX.AxDbDocument.16"; The .16 is for 2004
)
)
(vla-open DBXOBJ (findfile DWGNAME))
(vlax-for LOOBJ (vla-get-layouts DBXOBJ)
(vlax-for OBJ (vla-get-block LOOBJ)
(vla-put-color OBJ 0)
)
)
(vlax-release-object DBXOBJ)
)

jwanstaett
2004-08-13, 02:19 PM
just a note: on your blocks you may what to use ByBlock not ByLayer If you use Byblock you can change the Color objects in a block by changing color of the block
if you use ByLayer you will need to change the color of the layer the block is on

jwanstaett
2004-08-13, 02:31 PM
Note: Peter code will change the color of all object in the drawing to ByLayer
Model Space and all Laylouts Pager Spaces are blocks in the Drawing. And if you have Xref in the drawing it will try to change the object in the xref to Bylayer.

CADmium
2004-08-17, 08:29 PM
a little tip -> look here http://ww3.cad.de/foren/ubb/Forum54/HTML/006737.shtml
There i (cadmium) have posted such a tool.

Tom Beauford
2004-08-18, 02:38 AM
Any plans for an English translation of that site?

CADmium
2004-08-18, 06:27 AM
no, this is a forum for the german-speaking ACAD-Users... but i thing, follow the Links and downloading the Lisp and understand it, isn't to hard.

Glenn Pope
2004-08-18, 01:20 PM
If you have the google toolbar installed, you can translate the page into English. It's not prefect, but it's understandable.

CBLENDERMANN
2004-08-19, 06:23 PM
THank you for all the info. A lot of usefull dat , the lisp from the web works wuite nicelly on blocks within a drawing... Still working on some of the other tips.
Good day to you all'
Cord B.