Registered forum members do not see this ad.
An old FAQ I wrote a while back...
http://www.cadtutor.net/forum/showpo...49&postcount=4
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Thanks for the explanation VVA. So these would be needed if I were to include them in another lisp without the defun name to carry the variable through that command.
The code does not work on paper view
Because it invokes a call to command function. it only "erase" objects on the current layout.
Quick mod:
Code:(defun C:edims (/ ss) (if (setq ss (ssget "_x" (list (cons 0 "*DIMENSION")))) (repeat (sslength ss) (entdel (ssname ss 0)) (ssdel (ssname ss 0) ss)) ) (princ) )
Another:
Will delete all Dimension types found in all layouts and in all blocks and nested blocks.Code:(defun c:deldims ( / d ) (vlax-for b (vla-get-blocks (setq d (vla-get-activedocument (vlax-get-acad-object)))) (if (eq :vlax-false (vla-get-isxref b)) (vlax-for o b (if (wcmatch (vla-get-objectname o) "AcDb*Dimension*") (vl-catch-all-apply 'vla-delete (list o)) ) ) ) ) (vla-regen d acallviewports) (princ) ) (vl-load-com) (princ)
Will omit Dimensions in XRefs and on locked layers.
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
entdel / entmod will still fail to delete / modify entities on locked layers, however, when these functions fail they return nil rather than error. When Visual LISP functions fail, they cause an exception to occur.
Compare the behaviour of:
Code:AutoLISP Visual LISP ------------------------------------------ entdel vla-delete entmod vlax-put-property tblsearch / dictsearch vla-item etc.
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper
Registered forum members do not see this ad.
You can apply it with locked layers?
Bookmarks