layer manager help

lukebui

Usenet Archive
Joined
Jan 27, 2004
Messages
1
Reaction score
0
I create a button that tell it to restore a certain layer manager and plot it out. I have a problem that if the layer manager doesn't exist then it cancel the command.

Is there a way that i can told it to loop that command. meaning that If it doesn't find the layer then skip to the next.

Thank for your help
 
:

Lukebui,

Try this:

(if (tblsearch "Layer" "Desired_layer") (freeze/thaw/off/on) );if

Is this what you are looking for?

Scot-65
 
I'm not sure what you mean by 'layer manager', however, you can check if a 'layername' exists, and take action, based on that. Here is a function to check if a layer exists.

;; check_layer.lsp
;;
;; Usage: (setq Check (check_layer "mylayername")) -> in Lisp ;; Returns: 'Check' ;; (if (= Check 1); layer name was found ;; (if (= Check 0); layer name was not found ;; (defun check_layer (la_name / laylist lt ln lx) (setq laylist nil Check 0) (setq lt (tblnext "LAYER" T)); reset to top of Table (while (setq lt (tblnext "LAYER")) (setq ln (cdr lt)) (setq lx (strcase (cdr (assoc 2 ln)))) (if (or (= la_name "0")(= lx (strcase la_name))) (setq Check 1) ); end if ); end while (princ) ); end function (princ); silent load
 
If you mean the 'layer manager' functions (in Bonus Tools, R14) don't exist (when you pick the button), Then in your Acad.lsp file do:
(if (findfile "ac_bonus")(load "ac_bonus")); load bonus tools
 
Correction.
(if (findfile "ac_bonus.lsp")(load "ac_bonus.lsp")); load bonus tools

Sorry bout that.

Bob
 

Latest threads

Back
Top