lsip to by pick the point on polyline and draw a aligned distance on horizontal line

lsip to by pick the point on polyline and draw a aligned distance on horizontal line

nilesh.bhosale
Advocate Advocate
741 Views
2 Replies
Message 1 of 3

lsip to by pick the point on polyline and draw a aligned distance on horizontal line

nilesh.bhosale
Advocate
Advocate

Dear All,

i am extremely i need of this program

can anyone provide me the same?

 

" i have an polyline and it has many interface random points and i have to mark those points on horizontal straight line.

sample drawing attached.

i have to do this exercise on many polylines so i need its lisp program 

 

 

0 Likes
Accepted solutions (1)
742 Views
2 Replies
Replies (2)
Message 2 of 3

Sea-Haven
Mentor
Mentor
Accepted solution

Try this, have you multi posted ? Note dimension style needs to be set or at least dimscale.

; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/measure-distance-on-polyline-by-inserting-block-by-clicking-at/td-p/11018354

(defun c:test ( /  ltsobj lst lstent obj obj1 obj2 intpt dist len d1 d2 end start ead dy dimoff)

(setq lstent '() lst '() rad 250 dimoff 0.0 dy 2000.0)

(setq ent (entsel "\nSelect alignment near end"))
(setq pt1 (cadr ent))
(setq obj1 (vlax-ename->vla-object (car  ent)))
(setq start (vlax-curve-getstartPoint obj1))
(setq end (vlax-curve-getEndPoint obj1))
(setq len (vla-get-length obj1))
(setq d1 (distance pt1 end) d2 (distance pt1 start))
(if (< d1 d2)
(command "pedit" ent "R" "")
)


(while (setq obj (car (entsel "\nPick crossing line work Enter to finish/skip")))
(setq lstent (cons obj lstent))
)

(if (= lstent nil)
(princ "\nnothing to do")
(progn
(foreach ent lstent
(setq obj2 (vlax-ename->vla-object ent))
(setq intpt (vlax-invoke obj1 'intersectWith obj2 acExtendnone))
(if (= intpt nil)
(princ "\nlines do not intersect")
(setq dist (vlax-curve-getdistatpoint obj1 (list (car intpt)(cadr intpt)))
      lst (cons dist lst))
)
)
)
)

(while (setq pt (getpoint "\nPick points on line Enter to finish/skip"))
(setq dist (vlax-curve-getdistatpoint obj1 pt)
      lst (cons dist lst))
)

(setq lst (vl-sort lst '<))

(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)


(command "line" (setq pt (getpoint "\nPick point for line ")) (polar pt 0.0 len) "")
(command "circle" pt rad)
(foreach dist lst
(command "circle" (polar pt 0.0 dist) rad)
(setq pt2 (mapcar '+ pt (list 0.0 (setq dimoff (+  dimoff dy)) 0.0)))
(command "dimhorizontal" pt (polar pt 0.0 dist) pt2)
)
(setq pt2 (mapcar '+ pt (list 0.0 (setq dimoff (+  dimoff dy)) 0.0)))
(command "dimhorizontal" pt (polar pt 0.0 len) pt2)
(command "circle" (polar pt 0.0 len) rad)

(setvar 'osmode oldsnap)
(princ)
)

(c:test)

 

 

0 Likes
Message 3 of 3

nilesh.bhosale
Advocate
Advocate

Dear Sir,

Thank you very much.

 

i am extremely happy to work with this program this is perfectly working as desired.

 

thank you very much for spare time for me take make this program

it will save my hours.

0 Likes