Hi
I need a script to replace the following as I have to use this a lot.
this is what I currently do:-
1, qselect
2, apply to : Entire drawing
3, Object type: polyline
4, properties: Length
5, Operation: =Equals
6, value: fixed size (see below)
7, how to apply: Include in new selection set
8, Append to curent selection set is unticked
9, Delete selection set.
the above gets run 2 time 1 with value of "444.5" next with "63.5" and next with "442.736" ( last one does not allways retune anything but still needs to be run just in case).
can anyone help me out please.
Simon
Solved! Go to Solution.
Solved by phanaem. Go to Solution.
Try this.
(defun C:TEST ( / *error* ss d ss1 i e)
(or
(setq ss (ssget "_I"))
(setq ss (ssadd))
)
(defun *error* (msg)
(sssetfirst nil nil)
(and
msg
(not (wcmatch (strcase msg) "*CANCEL*,*QUIT*,*EXIT*"))
(princ (strcat "\nError: ") msg)
)
(sssetfirst nil ss)
)
(if
(setq ss1 (ssget "_X" '((0 . "*POLYLINE"))))
(while
(setq d (getdist "\nEnter polyline length: "))
(sssetfirst nil nil)
(repeat
(setq i (sslength ss1))
(setq i (1- i)
e (ssname ss1 i)
)
(if
(equal
(vlax-curve-getdistatparam e
(vlax-curve-getendparam e)
)
d
1e-5
)
(ssadd e ss)
)
)
(sssetfirst nil ss)
)
)
(princ)
)
That worked fine thanks for that.
Just the one more question.
The only way I have got any LSP file to run todate is to click on "load Application" in Manage ribben tab is there a way to have this auto load on startup so then I only have to type the command when I need it without haveing to load it each time?
Thanks again for your time.