TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: PM on November 07, 2022, 11:39:51 AM
-
Hi i use this code to find duplicate block on polyline vertices. If there no duplicate block in drawing i want to give me an princ "<< No duplicate block found >>". I add this text but every time i run the code i see it. Something is not correct. Can any one help?
(defun c:blockdup
( / ent idx ins lst rtn sel
) )
)
)
(princ "\n<< No duplicate block found >>")) <-- I have problem here
)
)
)
Thanks
-
You need to add some simple IF logic to your prompts. Do you know what sslength returns?
-
Hi ronjonp. sslength returns the number of duplicated block
-
I fix it thanks ronjonp
(defun c:blockdup
( / ent idx ins lst rtn sel
) )
)
)
(princ "\n<< No duplicate block found >>") )
)
)
)
-
I fix it thanks ronjonp
(defun c:blockdup
( / ent idx ins lst rtn sel
) )
)
)
(princ "\n<< No duplicate block found >>") )
)
)
)
Close:
(princ "\n<< No duplicate block found >>") )
Which could also be nested like so:
"No duplicate block "
)
" found."
)
)
-
Thank you ronjonp