Hi All,
I have a good one for you and would be very apprecative of a good lisp to help me out. I need a routine that takes the properties of all the layers in a drawing and applies them to each individual entity in that drawing. For example, if I have a line with properties that are all "bylayer" but in the layer manager the color is set to color 1, dashed, lineweight 0.035mm... how do I get it to where if I click the line the manual properties for that object are changed to color 1, dashed, and lineweight 0.035mm. I'm looking for an automated process that will be able to select all objects within a drawing and have their manual properties changed.
Your help is much apprecaited.
Thanks!
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
@ksmith5 wrote:
.... I need a routine that takes the properties of all the layers in a drawing and applies them to each individual entity in that drawing. For example, if I have a line with properties that are all "bylayer" but in the layer manager the color is set to color 1, dashed, lineweight 0.035mm... how do I get it to where if I click the line the manual properties for that object are changed to color 1, dashed, and lineweight 0.035mm. I'm looking for an automated process that will be able to select all objects within a drawing and have their manual properties changed.
....
The attached may give you a start, at least. It was built to do pretty much just that to all entities in Block definitions, [and also to put them all on Layer 0, which can easily be removed], but the (while) function could be pulled out and adapted to work on all entities in the drawing instead. It applies only color and linetype, but lineweight could be added easily enough. Are you capable of doing such modifications yourself?
I'm definaltely a rookie when it comes to writing these things. I'm trying to learn, but this looks a bit advanced for my level. Would it be possible to help me out with it?
@ksmith5 wrote:
Hi All,
I have a good one for you and would be very apprecative of a good lisp to help me out. I need a routine that takes the properties of all the layers in a drawing and applies them to each individual entity in that drawing. For example, if I have a line with properties that are all "bylayer" but in the layer manager the color is set to color 1, dashed, lineweight 0.035mm... how do I get it to where if I click the line the manual properties for that object are changed to color 1, dashed, and lineweight 0.035mm. I'm looking for an automated process that will be able to select all objects within a drawing and have their manual properties changed.
Your help is much apprecaited.
Thanks!
Try this ksmith5
(defun c:chp (/ Layers eprop ss i e cl) ;; pBe Aug 13 2014 ;;; (setq Layers (vla-get-layers (vla-get-ActiveDocument (vlax-get-acad-object)) ) eprop '("LineWeight" "Linetype" "Color") ) (if (setq ss (ssget ":L")) (repeat (setq i (sslength ss)) (setq e (vlax-ename->vla-object (ssname ss (setq i (1- i))))) (setq cl (vla-item layers (vla-get-layer e))) (mapcar '(lambda (a b) (vlax-put e a b)) eprop (mapcar '(lambda (p) (vlax-get cl p)) eprop) ) ) ) (princ) ) (vl-load-com)
HTH