Isolate xref nested layer

Discussion in 'AutoCAD' started by timfrost, Oct 8, 2004.

  1. timfrost

    timfrost Guest

    I looked in the past post. I have tried many on them however, none seems to work with AutoCAD 2005.

    I want to be able to isolate a xref layer or a regular layer or a nested xref layer. I know there is something in express tools but they do not work.

    Does anyone have a layer routine that works that they would like to share.

    Thanks,
    Tim
     
    timfrost, Oct 8, 2004
    #1
  2. timfrost

    GaryDF Guest

    Try this one

    ;;; Nested Entity Off by Dan Allen
    ;;; Nested Entity Isolate
    (Defun c:XNI (/ o1 o2)
    (setq o1 (nentsel "\n* Select nested entity to isolate layer on *"))
    (if o1
    (progn
    (setq o2 (cdr (assoc 8 (entget (car o1)))))
    (if (= o2 "0")
    (setq o2 (cdr (assoc 8 (entget (car (cadddr o1))))))
    )
    (SETV "expert" 5)
    (command "_.-layer" "thaw" "0" "Make" "0" "")
    (command "_.-layer" "off" (strcat "~" o2) "")
    (RSETV "expert")
    (princ o2)
    ) ;end progn
    (princ "\n* No entities selected *")
    ) ;end if
    (princ)
    )

    Gary


    layer. I know there is something in express tools but they do not work.
     
    GaryDF, Oct 8, 2004
    #2
  3. timfrost

    timfrost Guest

    Gary,

    Thanks, for the reply but it does not work for me.

    I get the following error

    Command: xni
    * Select nested entity to isolate layer on *; error: no function definition:
    SETV
     
    timfrost, Oct 11, 2004
    #3
  4. timfrost

    GaryDF Guest

    Sorry, I was in too much of a hurry. Here are the functions.

    Gary


    ;; SETV function saves setvar settings to be reset at end with RSETV
    ;; (setv "cmdecho" 0) set cmdecho off
    ;; (rsetv "cmdecho") resets cmdecho (see below)
    ;; taken from Essential AutoLISP by Roy Harkow
    (defun SETV (sysvar newval / cmdnam)
    (setq cmdnam (read (strcat sysvar "1"))) ;Create [savevar]1
    (set cmdnam (getvar sysvar)) ;Save [savevar]'s value
    (setvar sysvar newval) ;Then set [savevar] to new value
    )
    ;;;
    (defun RSETV (sysvar / )
    (if (eval (read (strcat sysvar "1"))) ;Only change if exists
    (progn
    (setq cmdnam (read (strcat sysvar "1"))) ;Create [savevar]1
    (setvar sysvar (eval cmdnam)) ;Restore [savevar]'s value
    (set cmdnam nil)
    ) ;end progn
    ) ;end if
    )
     
    GaryDF, Oct 11, 2004
    #4
  5. timfrost

    timfrost Guest

    Thanks Gary I will give it another spin.

    Thanks for your time.

    Tim
     
    timfrost, Oct 11, 2004
    #5
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.