harrison-matt Posted October 1, 2010 Posted October 1, 2010 All, I am confused on how i can create a layer list using VL and see if i can find a perfect match of a particular layer i am looking for. Example: Is P-DOMW-CPIP-D existing in the drawing? If so, continue. If not, alert the user. Simple, but i have exhausted my self searching for some samples in the help menu. Thanks ahead of time, Matt Quote
Lee Mac Posted October 1, 2010 Posted October 1, 2010 (tblsearch "LAYER" "P-DOMW-CPIP-D") Or if you really want VL... (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-item (list (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object) ) ) "P-DOMW-CPIP-D" ) ) ) ) Or checking against a constructed layer list: (member "P-DOMW-CPIP-D" (while (setq def (tblnext "LAYER" (null def))) (setq lst (cons (cdr (assoc 2 def)) lst)) ) ) (vl-position "P-DOMW-CPIP-D" (vlax-for l (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object) ) ) (setq lst (cons (vla-get-Name l) lst)) ) ) 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.