Steven P Posted May 10, 2021 Posted May 10, 2021 Good afternoon. This is todays problem for me, I have a set of drawings, 1000+ layers in each and I want to set all the layers in each to be the same. So all layer '0' will be On, Black, and Thawed, '5' might be On, Red and Frozen and so on in all the drawings. I have a little lisp that does that in model space by copying the details to a temporary text file and using that to paste the details to a drawing later. The plan was -once- to add a pop up where I could select which layer attributes to copy. The problem being now I want to do the same using the viewports, so viewport colours, Viewport freeze, and so on, but I don't know how to get the layer information from the viewport. My question is how can I get a layers VP-colour, VP-Freeze ? (Note, I was looking at the layerstate options in AutoCAD but wanted to have a bit more control over what attributes are copied over) Thanks. (probably something silly and easy but I haven't seen it yet) Quote
mhupp Posted May 10, 2021 Posted May 10, 2021 (edited) Probably need to use layer states. https://www.theswamp.org/index.php?PHPSESSID=liu951ho7q5s5nab8ntohghhv5&topic=44690.msg499120#msg499120 --edit-- LOL I should really finish reading before posting. Edited May 10, 2021 by mhupp 2 1 Quote
tombu Posted May 10, 2021 Posted May 10, 2021 I'd recommend layer states as well. Being able to apply them as viewport overrides is really useful as well. Adding this to your Acaddoc.lsp prevents layers not included in the layer state from being turned off unless you want them to: (vl-registry-write (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar "cprofile") "\\Dialogs\\AcLayerApps:LayerStatesManager") "LayerNotFound" "0") ; Layer States Manager - Do not turn off layers not found in layer state 1 Quote
Steven P Posted May 11, 2021 Author Posted May 11, 2021 Thanks so far, I might have to use layer states just for now then, but am sure there must be a way somewhere.. just got to hunt it down Quote
tombu Posted May 11, 2021 Posted May 11, 2021 Lee Mac's Steal From Drawing http://www.lee-mac.com/steal.html would be another way. I've always used layer states for setting layer properties though. Copy the layers you want in the layer state to a blank drawing and create the layer state there so that setting it current in another drawing will not add or modify any other layers. Layer states restore current layer as well. Doing it this way it's important layers not in the layer state aren't set to be turned off. This does require using the dialog box as picking from Layer State ribbon drop-down doesn't recognize settings set in the dialog box. I use them heavily as many of the layers required while creating our drawings are not displayed on final plans and different sheets show different information. You could add layers and set their properties with macros using -LAYER (Command) https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-2C75A883-10CA-4B6C-96AC-BCD7A7794614 but it wouldn't help you with viewport overrides. The VPLAYER (Command) https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-EB4DA3DA-5466-4D48-9AEC-6828B82BDEF9 would do the viewport overrides but still wouldn't be as versatile or easy as using layer states. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.