←  Technical Questions

nanoCAD forum

»

Format Layer Tools

Duarte Ramos's Photo Duarte Ramos 26 Feb 2014

Hello
I've been using NanoCAD for the past couple of days and I am very satisfied, however there is something that I am missing sorely
I needed the old autocad express tools commands like Layon Layoff Layfrz Layth Laylck Layulk Laycr ect

I notices the bundled Usr guide mentions these commands are available, but I cant use them. Also I am missing the Format > Layer Tools menu they were supposed to be in.

Am i missing something here or are these commands some sort of additional addon or plugin you must activate?
Quote

Hellen_V's Photo Hellen_V 26 Feb 2014

Hello Duarte,

These commands are available in in NanoCAD Plus version only. You can execute them by opening of the Layers toolbar (Format -> Layers...).
Quote

Duarte Ramos's Photo Duarte Ramos 26 Feb 2014

Oh ok, that explains why I could not run or find those commands, thanks for the quick reply.
Quote

mike's Photo mike 02 Mar 2014

Yes, you can compensate the lack of these commands by using some LISP functions. I'm using some of them. They are not perfect, I'm not a professional lisp coder, but they make a life a bit easier. Feel free to make them better! :D
Functionality:
LL - select object and make it's layer current;
LLO - layer off (select object);
LLF - layer freeze (select object);
LP - back to previous state after LLO or LLF.

In the previous version of nanocad there was a possibility to add isolate function to this, but not any more as far as I know. Or maybe there is a way?

(defun c:ll ()
(setq objName (car (entsel)))
(setq objList (entget objName))
(setq objLay (cdr (assoc 8 objList)))
(command "_-layer" "s" objLay "")
)
(defun c:llo ()
(setq objName (car (entsel)))
(setq objList (entget objName))
(setq objLay2 (cdr (assoc 8 objList)))
(command "_-layer" "off" objLay2 "")
)
(defun c:llf ()
(setq objName (car (entsel)))
(setq objList (entget objName))
(setq objLay2 (cdr (assoc 8 objList)))
(command "_-layer" "FREEZE" objLay2 "")
)

(defun c:lp ()
(command "_-layer" "on" objLay2 "")
(command "_-layer" "THAW" objLay2 "")
)
Quote

Duarte Ramos's Photo Duarte Ramos 02 Mar 2014

WOW That is absolutely great, works like a charm!
I actually meant to do exactly that but time was not on my side, and my lisp is really really rusty, it was not very good to start with and I haven't used it in quite a while.
I made a fiew improvements to it, so that the layer off commits immediatly even if it is the current one and I also added a layer lock and unlock to it. I changed the aliases arround to suit my preference but you can easily change them back.


(defun c:lc ()
(setq objName (car (entsel)))
(setq objList (entget objName))
(setq objLay (cdr (assoc 8 objList)))
(command "_-layer" "s" objLay "")
)

(defun c:lf ()
(setq objName (car (entsel)))
(setq objList (entget objName))
(setq objLay2 (cdr (assoc 8 objList)))
(command "_-layer" "off" objLay2 "yes" "")
)

(defun c:ll ()
(setq objName (car (entsel)))
(setq objList (entget objName))
(setq objLay2 (cdr (assoc 8 objList)))
(command "_-layer" "lock" objLay2 "")
)

(defun c:lu ()
(setq objName (car (entsel)))
(setq objList (entget objName))
(setq objLay2 (cdr (assoc 8 objList)))
(command "_-layer" "unlock" objLay2 "")
)

(defun c:lfr ()
(setq objName (car (entsel)))
(setq objList (entget objName))
(setq objLay2 (cdr (assoc 8 objList)))
(command "_-layer" "FREEZE" objLay2 "")
)

(defun c:lt ()
(command "_-layer" "on" objLay2 "")
(command "_-layer" "THAW" objLay2 "")
)

Thank you so much for sharing this, you just made my life a lot easier!
Quote

Luca De Moliner's Photo Luca De Moliner 09 Jul 2015

TY very much for these lisps. Very useful expecially "select objects and make layer current".
To bypass the lack of "isolate current layer" I do this:

"select object and make layer current" (LC)> layer > layer walk
that's IT!
when you finish working on that layer you deactivate layer walk an everything goes back to the previous layer state.

there is a step more to do if compeared to express tools but it's OK.

I come from Autocad and ZwCAD next. NANOCAD rules. I'm seriously considering to buy + version!

congrats to developers
Quote

omar moretti's Photo omar moretti 02 Sep 2017

think this is what I'm searching for...
anyone can explain me how to add/activate LISP commands?
Quote

Hellen_V's Photo Hellen_V 12 Sep 2017

View Postomar moretti, on 02 September 2017 - 09:38 AM, said:

think this is what I'm searching for...
anyone can explain me how to add/activate LISP commands?
use APPLOAD command.
Quote

Jason Warren's Photo Jason Warren 09 Nov 2022

Hi,
Is there a way to turn a Layer OFF via the command line. eg Command: LAYOFF "Layer Name" <Enter>
Many thanks,
Jason

*Update, all sorted, thank you for the pointers... ;o)
Quote