ajithkumar.t Posted Tuesday at 05:03 AM Posted Tuesday at 05:03 AM (defun c:deleteCirclesByDiameter (/ ss diaexception f x ) (setq f 0.5000) (setq x globalCleanedValue) (setq ss (ssget "_X" '((0 . "CIRCLE")))) (setq diaexception '(0.6875 0.6880)) (if ss (progn (prompt (strcat "\nFormatted Value of x: " (rtos x 2 4))) (setq index 0) (repeat (sslength ss) (setq ent (ssname ss index)) (setq dia (* 2 (cdr (assoc 40 (entget ent))))) (if (and (> x f) (> x dia) (not (and (member dia diaexception) (= x 0.75)))) (progn (entdel ent) (prompt (strcat "\nDeleted Circle: " (itoa (1+ index)) ", Diameter: " (rtos dia 2 4) ", Thickness: " (rtos x 2 4)))) (prompt (strcat "\nSkipped Circle: " (itoa (1+ index)) ", Diameter: " (rtos dia 2 4) ", Thickness: " (rtos x 2 4)))) (setq index (1+ index)) ) (prompt "\nCircles with diameter less than x have been deleted.") ) (prompt "\nNo circles found in the drawing.") ) (princ) ) This is the code for deleting circles based on some condtion, i have attached sample dxf, in that dxf file if my condition is true circles will be deleted, now what i want is for the same condition slots also should be delete if conditions true....thanks in advance.. Quote
Emmanuel Delay Posted Tuesday at 10:46 AM Posted Tuesday at 10:46 AM Can you upload a dwg file of that? Quote
ajithkumar.t Posted Tuesday at 10:54 AM Author Posted Tuesday at 10:54 AM yeah sure..find the attchament below. sample.dwg Quote
Emmanuel Delay Posted Tuesday at 12:19 PM Posted Tuesday at 12:19 PM So you want the cyan slot to also disappear, right? Just one thing, what's globalCleanedValue ? What value does it have? It's glogal, so declared outside the function Quote
ajithkumar.t Posted Tuesday at 12:52 PM Author Posted Tuesday at 12:52 PM (edited) Yes that cyan slot. globalCleanedValue is a decimal value..for the above dwg, globalCleanedValue is 0.5 which I got from "1/2" of "PROFILE:PL1/2". This value will varies depends on the dwg. Edited Tuesday at 12:53 PM by ajithkumar.t 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.