FIND MISSING LAYER ?

FIND MISSING LAYER ?

jaimuthu
Advocate Advocate
291 Views
3 Replies
Message 1 of 4

FIND MISSING LAYER ?

jaimuthu
Advocate
Advocate

I have standard layer A B C AND D i draw object use the standard layer a b c  i did not use  layer D find the Missing layer in msgbox

(defun C:FindMissingLayers (/ standardLayers existingLayers missingLayers)
  (setq standardLayers '("A" "B" "C" "D")) ; Define your standard layers here
  (setq existingLayers '())

  (foreach layer standardLayers
    (if (tblsearch "LAYER" (strcat "ACAD_LAYER:" layer))
      (setq existingLayers (cons layer existingLayers))
    )
  )

  (setq missingLayers (vl-remove-if '(lambda (x) (member x existingLayers)) standardLayers))

  (if (null missingLayers)
    (alert "No missing layers found.")
    (alert (strcat "Missing layers: " (apply 'strcat (mapcar '(lambda (x) (strcat x ", ")) missingLayers))))
  )
)

 

0 Likes
Accepted solutions (1)
292 Views
3 Replies
Replies (3)
Message 2 of 4

paullimapa
Mentor
Mentor
Accepted solution

change this:

  (foreach layer standardLayers
    (if (tblsearch "LAYER" (strcat "ACAD_LAYER:" layer))
      (setq existingLayers (cons layer existingLayers))
    )
  )

to this:

(foreach layer standardLayers
    (if (and(tblsearch "LAYER" layer)(ssget"x"(list(cons 8 layer))))
       (setq existingLayers (cons layer existingLayers))
    )
)

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 4

jaimuthu
Advocate
Advocate
THANKS FOR YOUR REPLY ITS WORK FINE
0 Likes
Message 4 of 4

paullimapa
Mentor
Mentor

glad to have helped...cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes