I am trying to create a legend for all the objects and linetypes in a drawing but want all the items to be on a single layer. Currently I have to manually apply the properties of the layer (color, lineweight, linetype, etc...) to the object so that they will plot the same.
I know the "setbylayer" command will strip all the objects properties and set them to bylayer, I want something kind of like the opposite.
If I use the "match properties" command it applies all the selected objects properties, but they are always "bylayer" I need something that gets the layers properties and applies it to the object.
I hope this makes sense, and thanks for any insight.
Mike
Solved! Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
With the objects 'within' the block located on LAYER 0 and set to BYLAYER, the object will inherit the layer properties they are located on.
Is this the sort of thing you are after https://autocadtips1.com/2011/05/01/autolisp-block-entity-color-change/
Hi @Anonymous,
It sounds like you are on the right track with match properties. However, after using this feature, if you isolate one layer at a time is it possible qselect all the objects and set the remaining property to the selected items?
Please select the Accept as Solution button if my post solves your issue or answers your question.
I am wanting to transfer the layer properties such as color, lineweight, linetype, etc... to the object.
Example: We have the project boundary drawn as a polyline that all of it's properties are set to "bylayer".
It is on the layer named C-BNDY-LINE.
That layer has the following properties.
Color: 6
Linetype: phantom2
Lineweight: 0.60mm
Transparancy: 0
I want to transfer the properties of the C-BNDY-LINE layer to a polyline drawn on the Layer called C-ANNO-LGND which has different properties.
That is what I do currently. I am just trying to setup a master template with all our firms objects and linetypes and was looking for a more automated way to transfer the properties.
Well, two routines I can offer. Lee Mac's Legend and my SetByLayerReverse...
If you are using .STB in your files you simply select the objects and change the plotstyle name with properties.
GrantsPirate
Piping and Mech. Designer
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.
Please excuse me for taking this topic back alive, but i found this lisp problematic with "lineweight". When it finds ByLayer value it changes it, but always to "Default", not to value used by layer. Is there any way to fix this up?
By the way this procedure should be build in, with multiple "ByLayer" values in Your drawing MAPEXPORT command becomes quite useless.
wow, I'm using this routine once in awhile, but never noticed... thx.
;; If the object's properties color, linetype and lineweight are ByLayer, then these are changed according the layer. (vl-load-com) (defun c:SetByLayerReverse (/ *error* adoc layer obj en ss i tcol) (defun *error* (msg) (vla-endundomark adoc) (princ msg) (princ)) (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object)))) (if (setq ss (ssget)) (repeat (setq i (sslength ss)) (setq en (ssname ss (setq i (1- i))) obj (vlax-ename->vla-object en) layer (vla-get-layer obj)) (if (not (assoc 62 (entget en))) (progn (vla-put-color obj (cdr (assoc 62 (tblsearch "layer" layer)))) (if (setq tcol (assoc 420 (entget (tblobjname "layer" layer)))) (entmod (append (entget en) (list tcol)))))) (if (not (assoc 6 (entget en))) (vla-put-linetype obj (cdr (assoc 6 (tblsearch "layer" layer))))) (if (not (assoc 370 (entget en))) (vla-put-lineweight obj (cond ((cdr (assoc 370 (entget (tblobjname "layer" layer))))) (-3)))))) (vla-endundomark adoc) (princ) )
Can't find what you're looking for? Ask the community or share your knowledge.