See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: I want to extract layer info...

  1. #1
    100 Club sturner's Avatar
    Join Date
    2004-05
    Location
    Maryland (sigh)
    Posts
    149
    Login to Give a bone
    0

    Question I want to extract layer info...

    is there a way to extract from the drawing database what layers including xref layers. that are on, off and frozen in model space, paper space and in the viewports, including the tabs. and than take this info. and use it as a script or such and apply it to the drawing after changes have been made. i know i can create a layer state but it will not work after xrefs have been reloaded. any ideas??

  2. #2
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    1

    Default Re: I want to extract layer info...

    Hi

    If you have Express Tools take a look at the LMan command -

    PullDownMenu: Express -> Layers -> Layer Manager (hint use the Import & Export options .LAY file)

    LMan will do exactly what you want (if I understand correctly, that is).

    Layer States within the Layer Dialog Box have a lot to learn from the functionality offered by LMan.

    Have a good one, Mike

  3. #3
    100 Club sturner's Avatar
    Join Date
    2004-05
    Location
    Maryland (sigh)
    Posts
    149
    Login to Give a bone
    0

    Default Re: I want to extract layer info...

    it could just be my version (2004) but once the xref is reloded or detatched and reattatched it will not restore those settings.

  4. #4
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: I want to extract layer info...

    Hi

    Have you tried Exporting to a .LAY file.

    Do your Xref stuff (Reload / Detach / ReAttach).

    Import the .LAY file and Restore.

    Honestly the above method works in AutoCAD 2004 (did for me when I experimented here a few minutes ago).

    Have a good one, Mike

  5. #5
    100 Club sturner's Avatar
    Join Date
    2004-05
    Location
    Maryland (sigh)
    Posts
    149
    Login to Give a bone
    0

    Default Re: I want to extract layer info...

    no dice, i get in the command line:
    Warning. Layer "13782-XCOND|BE-EASMNT" is not defined in "ACET-LAYISO". Save
    the layer state to update it.
    any ideas?
    Last edited by sturner; 2004-09-17 at 05:02 PM.

  6. #6
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: I want to extract layer info...

    Hi

    That's exactly what I get BUT!!! once you click the "Close" button (don't touch the "Save" button) within the LMan Dialog Box the Layer States should be correctly displayed / restored.

    Have a good one, Mike

  7. #7
    100 Club sturner's Avatar
    Join Date
    2004-05
    Location
    Maryland (sigh)
    Posts
    149
    Login to Give a bone
    0

    Default Re: I want to extract layer info...

    still nothing, i have tried in on various files and cominations with the layer states. with no success, it will error out or do nothing.
    -grrrrrrrrrrrrrrr

  8. #8
    AUGI Director scott.wilcox's Avatar
    Join Date
    2015-11
    Location
    Edmonton, Alberta
    Posts
    990
    Login to Give a bone
    0

    Lightbulb Re: I want to extract layer info...

    Hi:

    You should make sure VISRETAIN is set to 1. It sounds like it is set to 0, which means that any layer information regarding the XREF is read from the XREF itself. Setting it to 1 will make AutoCAD read the layer settings for the XREF in the parent drawing.

    Type: Integer
    Saved in: Drawing
    Initial value: 1

    Controls the visibility, color, linetype, lineweight, and plot styles (if PSTYLEPOLICY is set to 0) of xref-dependent layers.


    0 The layer table, as stored in the reference drawing (xref) takes precedence. Changes made to xref-dependent layers in the current drawing are valid in the current session only and are not saved with the drawing. When the current drawing is reopened, the layer table is reloaded from the reference drawing and the current drawing reflects those settings. The layer settings affected are On, Off, Freeze, Thaw, Color, Ltype, LWeight, and PStyle (if PSTYLEPOLICY is set to 0).

    1 Xref-dependent layer changes made in the current drawing take precedence. Layer settings are saved with the current drawing's layer table and persist from session to session.
    Scott

  9. #9
    100 Club sturner's Avatar
    Join Date
    2004-05
    Location
    Maryland (sigh)
    Posts
    149
    Login to Give a bone
    0

    Default Re: I want to extract layer info...

    for this i need the visretain tuned off. i am updating linetypes in the xref drawings and need them to show in the final 'plot' drawings. once the xrefs are updated the visretain is turned on. but i want to retain the original layer settings on, off, frz, thaw etc....

  10. #10
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: I want to extract layer info...

    Hi

    For LMAN to work you need VisRetain = 1

    Below is from the Online Express Tools Help File -

    <snip>
    Note:
    Layer state information related to externally referenced layers is imported only if the xrefed layer already exists in the current drawing. Local layers are created as needed during an import operation. Also, if you save a layer state that contains xrefed layers, the state saves those layers only when VISRETAIN is set to 1.Tip("\Save a layer state to use for plotting your drawing. If you restore that state just \before you plot, you will not have to worry about wasting time with bad plots due \to an incorrect layer setting such as a layer turned off, a wrong color, or an incorrect \linetype. You will need to resave this state every time you add a new layer to the \drawing. You can also export the settings and use them for an entire project.\");
    </snip>

    With that said you can still get this to work for you, within the LMAN Dialog Box -

    Click the Options button (bottom left) -> Untick the Linetype Status Check Box -> Click the OK button

    Now Save the Layer States you require.

    Export them as .LAY files.

    Detach the required Xref file.

    Make necessary changes (Linetypes) to the Xref file.

    Reattach the Xref file.

    Import the saved .LAY files and Restore them.

    Have attached a ZIP file that contains the very simple experiment I carried out, ZIP contains -

    XrefChild.dwg (Xref file)
    XrefMaster.dwg (Master file, VisRetain = 1)
    Vport1.lay (Saved Layer States for Floating Viewport 1)
    Vport2.lay (Saved Layer States for Floating Viewport 2)

    Open XrefMaster.dwg should see XrefChild attached as an Xref.

    Detach XrefChild.

    Open XrefChild.dwg -> Change Layer Linetypes -> Save

    XrefMaster.dwg -> Attach XrefChild -> Within relevant Floating Viewport run the LMAN command -> Import the relevant .LAY file -> Restore -> The Floating Viewport should now correctly show Layers (Freeze/Thaw in current Viewport).

    Have a good one, Mike
    Attached Files Attached Files

Page 1 of 2 12 LastLast

Similar Threads

  1. Using layer info to create a new layer?
    By ReachAndre in forum AutoLISP
    Replies: 23
    Last Post: 2013-10-29, 08:43 PM
  2. Extract Block Info: Hyperlink
    By apraysman in forum AutoLISP
    Replies: 4
    Last Post: 2013-01-31, 11:05 PM
  3. Seeking info on Layer States
    By mdcoop_ak in forum CAD Management - General
    Replies: 2
    Last Post: 2007-09-26, 08:30 PM
  4. Extract all text from a layer or drawing
    By cadcamcim in forum AutoCAD General
    Replies: 1
    Last Post: 2005-08-07, 04:35 PM
  5. Extract Nested Block Info
    By Kris.Keller in forum AutoLISP
    Replies: 16
    Last Post: 2005-04-19, 09:56 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
  •