mhupp Posted September 28, 2021 Posted September 28, 2021 Reading your comment and got me thinking. This creates a temporary point at the insertion point of the block and uses that for test to delete the poyline. then deletes all the temporary points after the command is done. It's kinda messy exploding blocks and pasting them back in might as well just leave them alone + its faster. (defun c:foo (/ SS1 SS blk i lst en pts) (vl-load-com) (setq pts (ssadd)) (if (setq SS1 (ssget "_X" '((0 . "Insert") (2 . "C1666")))) (foreach blk (mapcar 'cadr (ssnamex SS1)) (setq pt (cdr (assoc 10 (entget blk)))) ;gets block insertion point (entmakex (list (cons 0 "POINT") (cons 10 pt))) ;creates temporary point (ssadd (entlast) pts) ;adds temporary point to a selection set ) (prompt "\nNo Plot ID Blocks in Drawing") ) (if (setq SS (ssget "_X" '((0 . "LWPOLYLINE") (8 . "C1602_0") (70 . 1) (410 . "Model")))) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (setq lst nil) ;clears lst of previous cords (repeat (setq i (fix (1+ (vlax-curve-getEndParam e)))) (setq lst (cons (trans (vlax-curve-getPointAtParam e (setq i (1- i))) 0 1) lst)) ) (if (ssget "_WP" lst '((0 . "POINT"))) (entdel e) ) ) (prompt "\nNo Plot Boundary's in Drawing") ) (vl-cmdf "_.Erase" pts "") ;delete all temporary points (princ) ) 9 hours ago, mk4176 said: I still lack a lot of knowledge in programming. I basically do my things by understanding others code then modify it to suit my needs. That's how I started out. just keep with it and it will get easier with time. Quote
mk4176 Posted September 29, 2021 Posted September 29, 2021 Thanks man for your kindness, professionalism and dynamism 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.