Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I dont 'understand my error.
In code below, if i run it for the first time it work's, but return error:
; erreur: Erreur Automation Calque incorrect
If run it a new instance, I have always this error.
Can you help, I'm lost...
I want to isolate layers , and in place of (getkword) run code to make something and at end restore layers
((lambda ( / ) (princ "\nChoix des entités pour désigner les calques à garder actif: ") (setq js (ssget) lay_stat nil) (cond (js (repeat (setq n (sslength js)) (setq lst_lay (cons (cdr (assoc 8 (entget (ssname js (setq n (1- n)))))) lst_lay)) ) (setq doc (vla-get-activedocument (vlax-get-acad-object)) space (if (eq (getvar "CVPORT") 1) (vla-get-PaperSpace doc) (vla-get-ModelSpace doc) ) ) (vlax-for lay (vla-get-layers doc) (setq lay_stat (cons (list lay (vla-get-freeze lay) (vla-get-lock lay) (vla-get-layeron lay) ) lay_stat ) ) (if (not (member (vla-get-name lay) lst_lay)) (vla-put-layeron lay :vlax-false) ) (if (eq (vla-get-name lay) "0") (progn (vla-put-freeze lay :vlax-false) (vla-put-lock lay :vlax-false) (vla-put-layeron lay :vlax-true) ) ) ) (setvar "CLAYER" "0") (print lay_stat) (getkword) (mapcar '(lambda (x) (vla-put-freeze (car x) (cadr x)) (vla-put-lock (car x) (caddr x)) (vla-put-layeron (car x) (cadddr x)) ) lay_stat ) ) ) ))
Solved! Go to Solution.