Message 1 of 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I work with main lisp include this function:
; dellin1 deletes all Lines shorter than given units outside & inside blocks
(defun dellin1 (mx / ss d i en mx)
; (vl-load-com)
(setq d 0) ; set # of deleted at 0
(if (setq ss (ssget "X" '((0 . "LINE,ARC,*POLYLINE,CIRCLE,SPLINE,ELLIPSE")))) ; select all LINES
(progn
(repeat (setq i (sslength ss))
(setq en (ssname ss (setq i (1- i))))
(if (< (vlax-curve-getdistAtParam en (vlax-curve-getEndParam en)) mx) ; if shorter or equal than given unit
(progn
(setq d(1+ d)) ; add # of deleted
(entdel en) ; delete
)
)
)
) ; progn
) ; if
(vlax-for blk (vla-get-blocks(vla-get-activedocument (vlax-get-acad-object))) ; select all blocks
(cond ( (and (= :vlax-false (vlax-get-property blk 'islayout)) ; not layout
;(= :vlax-false (vlax-get-property blk 'isxref)) ; not xref
(= :vlax-false (vlax-get-property blk 'isdynamicblock)) ; not dynamic
);end_and
(vlax-for itm blk
(if (and (or (= (strcase (substr (vlax-get itm 'objectname) 5)) "LINE")
(= (strcase (substr (vlax-get itm 'objectname) 5)) "POLYLINE")
(= (strcase (substr (vlax-get itm 'objectname) 5)) "CIRCLE")
(= (strcase (substr (vlax-get itm 'objectname) 5)) "ARC")
(= (strcase (substr (vlax-get itm 'objectname) 5)) "SPLINE"))
(< (vlax-curve-getdistatparam itm (vlax-curve-getendparam itm)) mx) ; if shorter or equal than given unit
);end_and
(progn
(setq d(1+ d)) ; add # of deleted
(vla-delete itm) ; delete
)
);end_if
);end_for
)
);end_cond
);end_for
(princ(strcat"\nDeleted Total of " (itoa d) " Lines."))(princ)
) ; defun dellin1
it work fine will most of all version of cad but in some versions (CAD 2019 i think) i got this error:
no function definition : vlax-curve-getEndParam occurred
so any suggestions please.
Thanks in advance
Solved! Go to Solution.