Jump to content

Viewport Layer Colours etc.


Steven P

Recommended Posts

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)

Link to comment
Share on other sites

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

 

  • Like 1
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...