Search the Community
Showing results for tags 'insertblock'.
-
Hi Guys, I need a Help here i have created a autolisp for insert Blocks , in this i am showing invalid layers for user I.e block not available for that layers. But my problems is if same layer found more then one it will repeat for all same layers i don't want to show error for every same layers. Please help me (defun c:parkingblock(/ addblock ss acaddocument space i snm lnm pos) (vl-load-com) (defun addblock (sp pos nm lname en / b) (setq b (vla-insertblock sp pos nm 0.1 0.1 0.1 0.0)) (vla-put-layer b lname) (vla-delete en) ) (if (setq ss (ssget '((0 . "POINT")))) (progn (setq acadDocument (vla-get-activedocument (vlax-get-acad-object))) (setq space (vla-get-modelspace acadDocument)) (repeat (setq i (sslength ss)) (setq snm (vlax-ename->vla-object (ssname ss (setq i (1- i))))) (setq lnm (vlax-get snm 'layer)) (setq pos (vla-get-Coordinates snm)) (cond ((= lnm "P_SEM_P") (addblock space pos "937" "P_SEM_P" snm)) ((= lnm "P_ILL_P") (addblock space pos "950" "P_ILL_P" snm)) ((= lnm "ALB_P") (addblock space pos "968" "ALB_P" snm)) ((= lnm "P_TEL_P") (addblock space pos "980" "P_TEL_P" snm)) ((= lnm "ZSD_P") (addblock space pos "953" "ZSD_P" snm)) ((= lnm "DIS_SOST") (addblock space pos "926" "DIS_SOST" snm)) (t (princ (strcat "\nBlock not found for Layer: " lnm)));; Problem ) ) ) ) (princ)) Regards, Ganesh