Results 1 to 7 of 7

Thread: LEGACY LAYERSTATES RANDOMLY GENERATED

  1. #1
    All AUGI, all the time mmiles's Avatar
    Join Date
    2006-03
    Location
    New York, NY
    Posts
    559
    Login to Give a bone
    0

    Default LEGACY LAYERSTATES RANDOMLY GENERATED

    I have several files which utilize layer states (LAS), and I share those files with others on a network. I use the LAS command often during my work, and before closing these files. Occasionally, the command creates LMAN layer states. I expect this to happen when I launch layer states manager on a file for the first time (i.e. save new file), but these files are in regular use for several weeks/months. What I want to know is where are they coming from?

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: LEGACY LAYERSTATES RANDOMLY GENERATED

    As I understand it, these are created from work you do within the active document, or the XREFs contained within it... Simple tasks such as LAYISO can produce an LMAN-related Layer State.

    They're abundant, they're annoying, I wish there were a way to preclude them from showing up in Layer States Manager, and I don't believe there's a way to prevent them - perhaps using an event handler / reactor to delete them at appropriate times prior to SAVE / CLOSE?

    Just went to create two Layer States in a drawing today, launching Layer States Manager for the first time in this drawing, and there were 13 LMAN-related Layer States already. *shrugs*



    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,673
    Login to Give a bone
    0

    Default Re: LEGACY LAYERSTATES RANDOMLY GENERATED

    I use layer states all the time and used to get those years ago. If you work with drawings or templates brought forward from old versions that used LMAN you will get that. Once you delete them from those files it shouldn't happen again. Haven't tested, but it may happen from importing layer states from one of those older files. Saving them in the current format doesn't help you must use the layer manager and delete the unwanted LMAN layer states.

  4. #4
    All AUGI, all the time mmiles's Avatar
    Join Date
    2006-03
    Location
    New York, NY
    Posts
    559
    Login to Give a bone
    0

    Default Re: LEGACY LAYERSTATES RANDOMLY GENERATED

    Yah....

    I know I have already deleted LMAN layer states in this file. They came back yesterday, unexpectedly. I think another user likes to cut/paste from old drawings - as in, that is how he draws nothing new - and the LMANs generated had names, so maybe it is related to that technique? Chalk it up to a minor annoyance!

  5. #5
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,673
    Login to Give a bone
    0

    Default Re: LEGACY LAYERSTATES RANDOMLY GENERATED

    Untested as I fortunately don't have any to test it on I can't say if either of these work, but they do not remove Layer States.

    From the Without a Net blog LMANKILL.LSP will remove all Express Tools LMAN layer states from the current drawing.
    Code:
    (defun C:LMANKILL (/ lyr ent cnt)
      (while (setq lyr (tblnext "layer" (not lyr)))
        (setq ent (entget (tblobjname "layer" (cdr (assoc 2 lyr)))'("RAK")))
        (if (and ent (assoc -3 ent))
          (progn
            (setq ent (subst '(-3 ("RAK")) (assoc -3 ent) ent))
            (entmod ent)
          )
        )
      )
      (princ)
    )
    or from http://forums.autodesk.com/t5/autoca...ce/td-p/360300 you could put
    Code:
    (
      (lambda (/ lay ent)
        (while (setq lay (tblnext "layer" (not lay)))
          (if (and (setq ent (entget (tblobjname "layer" (cdr (assoc 2 lay))) '("RAK")))(assoc -3 ent))
    	(entmod (subst '(-3 ("RAK")) (assoc -3 ent) ent))
          )
        )
      )
    )
    (princ "Layer states cleared.")
    (princ)
    in your ACADDOC.lsp file

  6. #6
    All AUGI, all the time mmiles's Avatar
    Join Date
    2006-03
    Location
    New York, NY
    Posts
    559
    Login to Give a bone
    0

    Default Re: LEGACY LAYERSTATES RANDOMLY GENERATED

    Hi Tom, thanks.

    Until now, I had no idea about an "ACADDOC.lsp" file. My knowledge stops at loading lisp routines and running them - I know no code. But, I like the idea... Does the ACADDOC lisp routine run (automated) when the program opens, and is the idea behind that code above to silently remove LMAN files in the background?

  7. #7
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,673
    Login to Give a bone
    0

    Default Re: LEGACY LAYERSTATES RANDOMLY GENERATED

    ACAD.lsp runs (automated) when the program opens (by default), ACADDOC.lsp runs (automated) when each drawing opens. As those LMAN layer states could be in any drawing the code would need to be in ACADDOC.lsp to remove them as the drawings are opened.

    About Auto-Loading and Running AutoLISP Routines link from AutoCAD help describes using ACAD.lsp and ACADDOC.lsp.

Similar Threads

  1. Auto-updating viewports to updated/modified layerstates
    By MTristram in forum AutoCAD General
    Replies: 1
    Last Post: 2012-10-15, 12:46 PM
  2. How to get rid of legacy tin reference
    By ddoucet in forum AutoCAD Civil 3D - Surfaces
    Replies: 3
    Last Post: 2008-04-16, 01:36 AM
  3. Replies: 4
    Last Post: 2007-07-02, 11:54 AM
  4. Want to Delete...pagesetup layerstates Utility
    By doggarn.70892 in forum AutoCAD General
    Replies: 0
    Last Post: 2005-05-11, 06:20 PM
  5. Replies: 0
    Last Post: 2005-04-21, 10:13 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
  •