Hi
I want to trim multiple polylines by a specified distance (5.0) from start. I have made following routine :-
(defun c:test ()
(vl-load-com)
(setq dist 5.0)
(setq ent (car (entsel "\nSelect object to trim:"))
obj (vlax-ename->vla-object ent)
lyr (vla-get-layer obj)
pt (vlax-curve-getPointAtDist obj dist)
tp1 (vlax-curve-getPointAtDist obj (+ dist 0.01))
tp2 (vlax-curve-getPointAtDist obj (- dist 0.01))
ang (angle tp2 tp1)
piby2 (/ pi 2.0)
tp3 (polar pt (+ ang piby2) 0.1)
tp4 (polar pt (- ang piby2) 0.1)
linent (entmakex
(list (cons 0 "LINE") (cons 8 lyr) (cons 10 tp3) (cons 11 tp4) (cons 210 (list 0.0 0.0 1.0)))
)
)
(command "TRIM" linent "" ent "")
(entdel linent)
(princ)
)
The above code works fine in trimming the lines. But the problem is that on certain lines, it trims the starting (5.0) which is my requirement but for some lines it trims the remaining line. How to always trim the starting 5.0 length only ?
Note : I cannot use Express Tool EXTRIM