Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Anonymous
2378 Vistas, 13 Respuestas

Is there way to apply a layer's properties to an object?

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

Anonymous
en respuesta a: Anonymous

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.

 

rkmcswain
en respuesta a: Anonymous

There is no built-in command to do this, but it could be done with a lisp (or other lang) routine.

R.K. McSwain     | CADpanacea | on twitter
Neil47
en respuesta a: Anonymous

john.vellek
en respuesta a: Anonymous

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.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Anonymous
en respuesta a: Anonymous

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.

Anonymous
en respuesta a: Anonymous

Select the polyline, then override those properties in the PROPERTIES PALETTE.

 

Anonymous
en respuesta a: Anonymous

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.

ВeekeeCZ
en respuesta a: Anonymous

Well, two routines I can offer. Lee Mac's Legend and my SetByLayerReverse... 

GrantsPirate
en respuesta a: Anonymous

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
EXPERT ELITE MEMBER
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.

Anonymous
en respuesta a: ВeekeeCZ

Thank you BeekeeCZ.

 

Works better than expected!!!!

Anonymous
en respuesta a: Anonymous

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.

ВeekeeCZ
en respuesta a: Anonymous

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)
)
Anonymous
en respuesta a: ВeekeeCZ

Now works perfectly, many thanks !