Vittorio Posted 1 hour ago Posted 1 hour ago (edited) Hi everybody, I'm trying to perform a very simple task, but the LISP just won't work on my German AutoCAD (Civil 3D 2025 German). I have a LISP routine to get all COGO points on layers with "-PT" suffix and want them to be turned off and frozen. (defun c:test01 (/ ss) (vl-load-com) (setq ss (ssget "_X" '((-4 . "<AND")(0 . "AECC_COGO_POINT")(8 . "*-PT")(-4 . "AND>"))) ) (command "_-layer" "freeze" ss "") (command "_-layer" "off" ss "") (sslength ss) (setq ss nil) (princ) ) I get an error upon running the LISP. Something like "invalid option keyword" since the -LAYER option "freeze" is called "frieren" in German. I've tried various command* combinations, but all fail. *) _-COMMAND or _.-COMMAND I'm lost here, those non-localized prefixes should work and I can't figure out why. Any help appreciated Edited 1 hour ago by Vittorio added text Quote
mhupp Posted 17 minutes ago Posted 17 minutes ago You cant freeze\off only the points its either the whole layer or nothing. this makes a selection set and process it to find what layers they are on and turns feezes and turns off those layers. if their are other things on that layer they will also be frozen and off. (defun c:test01 ( / ss lay laylst) (vl-load-com) (if (setq ss (ssget "_X" '((0 . "AECC_COGO_POINT") (8 . "*-PT")))) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (setq lay (cdr (assoc 8 (entget ent)))) (if (not (member lay laylst)) (setq laylst (cons lay laylst)) ) ) (foreach lay laylst (Command "_.-LAYER" "_Freeze" lay "") (Command "_.-Layer" "off" lay "") ) (prompt "\nNo matching COGO points found.") ) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.