Results 1 to 3 of 3

Thread: Applying Layer Settings to All Open Drawings

  1. #1
    I could stop if I wanted to
    Join Date
    2003-03
    Location
    Alberta
    Posts
    249

    Question Applying Layer Settings to All Open Drawings

    I have a function that will change the layer colors for a drawing. What I want to do now is use this function to apply the layer settings to all my open drawings. BUT - When I iterate through the document collection I get an eLockViolation (occurs when opening the LayerTable for write) on all the documents but the active document. What needs to be done to the other drawings so I can make changes to them?

    AutoCAD 2010
    AutoCAD Map 2010
    MS Visual Studio 2008

  2. #2
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,227

    Default Re: Applying Layer Settings to All Open Drawings

    Sorry for the belating
    Just a guess
    Try to use LockDocument:

    Code:
    Using doclock As DocumentLock = doc.LockDocument()
    < rest code to sel layer settings goes here >
    End Using
    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  3. #3
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043

    Default Re: Applying Layer Settings to All Open Drawings

    I got it to work using DocumentLocking. Thanks for the heads up J.

Similar Threads

  1. Replies: 2
    Last Post: 2011-04-28, 02:04 AM
  2. Applying a Page Setup to all drawings in Publish
    By neilcheshire in forum AutoCAD LT - General
    Replies: 2
    Last Post: 2007-06-22, 07:03 AM
  3. Copying Layer Settings Between drawings
    By neilcheshire in forum AutoCAD General
    Replies: 16
    Last Post: 2006-01-18, 12:25 AM
  4. Layer Manager & Layer drop down are slow to open.
    By Glenn Pope in forum AutoCAD FAQ (Read only)
    Replies: 0
    Last Post: 2005-03-17, 05:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •