TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: RGUS on August 10, 2018, 04:03:37 AM
-
With entities gripped in the drawing editor, how do I then select a layer from the Layer Control pulldown and change the entities to not only the Layer picked but the colour to ByLayer?
Will this require adding some lisp or reactor of some type?
It would have been great if the Layer Control changed to not only the Layer, but to the color and linetype of that layer.
Any help or suggestions are appreciated.
-
The color drop down does include the BYLAYER choice.
Also, what about using the SETBYLAYER command?
-
The color drop down does include the BYLAYER choice.
Also, what about using the SETBYLAYER command?
Yes, these do the job, but they form a two pick operation.
The 'Layer Control" dropdown changes the entity to the selected layer but in name only, it does not change the entity color or linetype to that of the selected layer as well.
I just wondered if there was a 'one pick' way of doing all three things without having to write my own "Layer change" command.
Thanks for your suggestions.
-
CNTRL+A then CNTRL+1 and make the changes in the properties palette.
-
-ch
All
P
C
Bylayer
-
CNTRL+A then CNTRL+1 and make the changes in the properties palette.
Thanks, Ron, this also does the job but as a multiple keyboard pick operation.
I guess Autodesk only intended the Layer Control pulldown menu to change the layer name only.
Looks like a special purpose routine to change gripped entity to layer_name, color_bylayer and linetype_bylayer from a list of layers in the drawing will be required.
A one pick operation.
Thank you for your help.
-
-ch
All
P
C
Bylayer
Thanks John
-
Here's something that will work within blocks too:
;; RJP » 2018-08-10
)
)
)
)
-
I guess Autodesk only intended the Layer Control pulldown menu to change the layer name only.
Well, of course. Why would they make the LAYER control drop-down control, modify anything other than the LAYER?
-
I guess Autodesk only intended the Layer Control pulldown menu to change the layer name only.
Well, of course. Why would they make the LAYER control drop-down control, modify anything other than the LAYER?
LOL... so true... no sense in creating yet another "system variable" in case some punters also want to draw using color_bylayer and linetype.
I need to be more thankful to AutoDESK, I apologise for my query.
-
I guess I'm the one who is confused.
LAYER and COLOR are two separate properties.
It seems as if you expect that by changing the layer, AutoCAD should also set the COLOR property to BYLAYER?
Should it also set the linetype to bylayer? What about transparency and lineweight?
-
I guess Autodesk only intended the Layer Control pulldown menu to change the layer name only.
Well, of course. Why would they make the LAYER control drop-down control, modify anything other than the LAYER?
LOL... so true... no sense in creating yet another "system variable" in case some punters also want to draw using color_bylayer and linetype.
I need to be more thankful to AutoDESK, I apologise for my query.
Set these two variable on startup and objects will default to be drawn linetype and color 'bylayer'.
(setvar 'celtype "bylayer")
(setvar 'cecolor "bylayer")
-
Here's something that will work within blocks too:
...
Here was something I wrote for ACAD 14--before vl--(doubt it worked within blocks though; and I don't remember autolisp enough to determine if it does) but it should work for all AutoCADs (windows or Mac).
(defun colorByLayer
(/ ss i elist
) )
)