TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: doductiep on September 12, 2021, 06:36:50 AM
-
I have two points on a polyline, the Pline is unClosed. Now I want to reject part of Pline out of two points by autolisp (please view the attachment figure)
Please help me, Thanks all
-
http://www.lee-mac.com/offsetpolysection.html
-
http://www.lee-mac.com/offsetpolysection.html
Thanks bro
-
http://www.lee-mac.com/offsetpolysection.html
Thanks for the recommendation HOSNEYALAA.
@doductiep, simply comment lines 25-32 and replace lines 131-133 in my program with:
(entdel (cdr (assoc -1 e)))
-
Why not 2 point circle then offset out, use trim. Note thought the pickbox sizing comes into affect so if set offset dist to small the pick point will not work.
; trim a pline outside using a 2 point circle
; By Alanh info@alanh.coma.au SEP 2021
(defun c:ctr ( / oldsnap pt1 pt2 obj1 obj2 obj3 intpts)
(setq pt1 (getpoint "\Pick point 1 ") pt2 (getpoint "\Pick point 2 "))
(setq obj1 (vlax-ename->vla-object (ssname (ssget pt1) 0)))
(command "circle" "2p" pt1 pt2)
(setq obj2 (entlast))
(vla-offset (vlax-ename->vla-object obj2) 10)
(setq obj3 (vlax-ename->vla-object (entlast)))
(setq intpts (vlax-invoke obj3 'intersectWith obj1 acExtendnone))
(vla-delete obj3)
(command "trim" obj2 "" "near" (list (nth 0 intpts)(nth 1 intpts)) "near" (list (nth 3 intpts)(nth 4 intpts)) "")
(command "erase" obj2 "")
(princ)
)
(c:ctr)
-
Thank @Lee Mac and @Bigal, your program are work very well
-
Lee Mac has it.. Thanks!