Message 1 of 13

Not applicable
12-14-2018
07:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey, I'm needing some help. I not experience in writing lisp but have a basic idea of following them. I'm trying to create a lisp that uses wildcards to select key words and then automatically put them on a predefined layer. I have something this so far but unfortunately, its not working.
(defun c:LAYCH ( / n )
(setvar 'CLAYER "0")
(while (setq d (tblnext "LAYER" (null d)))
(if (and (not (wcmatch (setq n (strcase (cdr (assoc 2 d)))) "*|*,0,DEFPOINTS, D-DETL-TEXT"))
(wcmatch n "*text*,*dim*")
)
(vl-catch-all-apply 'vla-put-name (list layer "C-DETL-TEXT")
)
)
)
(princ)
)
(if (and (not (wcmatch (setq n (strcase (cdr (assoc 2 d)))) "*|*,0,DEFPOINTS, D-DETL-TEXT"))
(wcmatch n "*text*,*dim*")
)
(vl-catch-all-apply 'vla-put-name (list layer "C-DETL-TEXT")
)
)
)
(princ)
)
Basically, I want to put all "text, dim, anno" layers on C-DETL-TEXT but not include the actual layer to be put on in the wildcard. I also want to add other "if statements" to include other key words to put like, "wall, building, etc." on the layer "C-DETL-LINE."
Can anyone help? It seems like what I have isn't working correctly. I would greatly appreciate any help. Thanks!
Solved! Go to Solution.