need help with layers, ms and vp

Discussion in 'AutoCAD' started by brajan, May 21, 2004.

  1. brajan

    brajan Guest

    hi there,
    i recently started in new company. they work a lot with viewports and i am looking for a lisp that can record layer state in model space with some layers turned off, go to paper space, turn all layers on, select one viewport and use recorded model space layer state to thaw in that active viewport layers that were turned off earlier in model space. thanks for any help.
     
    brajan, May 21, 2004
    #1
  2. Layer Manager (Command : lman) from Express tools is what you need - it is
    very good and powerful tool but has some tricky moments. First get familiar
    with it - read the Help and do some experiments. Core ACAD2004 program has
    another similar State manager but is not as powerful as Express Layer
    Manager.
    Good luck.
    John

    looking for a lisp that can record layer state in model space with some
    layers turned off, go to paper space, turn all layers on, select one
    viewport and use recorded model space layer state to thaw in that active
    viewport layers that were turned off earlier in model space. thanks for any
    help.
     
    John Georgiev, May 21, 2004
    #2
  3. brajan

    brajan Guest

    thanks but that is not what i'm looking for. hard to explain but this company uses plot routine with all layers on command just before sending plot to plotter and that's why i need all layers turned off to switch to thawed in particular viewport before plotting.
     
    brajan, May 21, 2004
    #3
  4. Turning layers ON and OFF is global - it cannot be specified for Layout or
    Viewport (we are talking about ON/OFF - one with the bulb, not FREEZE/THAW -
    the one with the snowflake, right?). If you turn layer OFF, it is OFF
    everywhere - all layouts and Model Space. Other question is if you wish to
    go to specific for each layout state when switching between them, but I
    don't think this is what you want.
    If I understand correctly you want to turn ON all layouts just before
    printing. You can add following line in this plotting routine just before
    the printing command:
    (command "layon")
    LAYON is another Express command which turns all OFF layers ON. If after the
    plotting you want to go back to the state before plotting add this just
    after the printing command:
    (command "layerp")
    Hope this time I got the correct idea of your question... Or maybe not
    again?
    Let me know.
    John

    company uses plot routine with all layers on command just before sending
    plot to plotter and that's why i need all layers turned off to switch to
    thawed in particular viewport before plotting.
     
    John Georgiev, May 21, 2004
    #4
  5. Actually I just found out that this command (LAYON) is loaded in demand, so
    to turn all layers on first you should loaded it. In this case the whole
    operation will look like this:
    (load "acetlayr.lsp")
    (command "layon")

    Sorry about this.
    John
     
    John Georgiev, May 21, 2004
    #5
  6. brajan

    brajan Guest

    i know it's confusing, sorry for my broken english, anybody else has idea what i'm talking about? any link to lisp that can maniputalte viewports layers and FREEZE LAYERS IN CURRENT VIEWPORT ( in paper space) that were TURNED OFF IN MODEL SPACE.
     
    brajan, May 21, 2004
    #6
  7. brajan

    T.Willey Guest

    I did a few test, it seemed to work for me. Hope it works for you.

    (defun c:MvFr()

    (command "undo" "end")
    (command "undo" "group")

    (setq LayTbl (tblnext "layer" T))
    (setq LayFrz (cdr (assoc 70 LayTbl)))
    (setq LayFrz (rem LayFrz 2))
    (setq LayOff (cdr (assoc 62 LayTbl)))
    (if (< LayOff 0)
    (setq LayOff 1)
    )

    (if (or (= LayFrz 1) (= LayOff 1))
    (setq LayList (list (cdr (assoc 2 LayTbl))))
    )

    (while (setq LayTbl (tblnext "layer"))
    (setq LayFrz (cdr (assoc 70 LayTbl)))
    (setq LayFrz (rem LayFrz 2))
    (setq LayOff (cdr (assoc 62 LayTbl)))
    (if (< LayOff 0)
    (setq LayOff 1)
    )

    (if (or (= LayFrz 1) (= LayOff 1))
    (if LayList
    (setq LayList (append (list (cdr (assoc 2 LayTbl))) LayList))
    (setq LayList (list (cdr (assoc 2 LayTbl))))
    )
    )
    )
    (if LayList
    (Frz)
    )
    (command "undo" "end")
    (princ)
    )


    (defun Frz()

    (command "._VPLAYER")
    (foreach layer LayList
    (command "_Freeze" layer "_Current")
    )
    (command "")
    (princ)

    )


    Tim
     
    T.Willey, May 21, 2004
    #7
  8. brajan

    T.Willey Guest

    Forgot to add....
    When using, have the viewport you want active and the model space setup the way you want it, as far as layers turned on and off and stuff like that, then run and it should save the layer setting to just that viewport.

    Tim
     
    T.Willey, May 21, 2004
    #8
  9. brajan

    brajan Guest

    Thank you very much!!!
     
    brajan, May 21, 2004
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.