This routine is used in mapping underground fiber optics.
Working with an existing polyline, the user indicates the length of the bore required,
selects a point on the existing polyline, and a circle is created based on that information.
The user then selects the two intersections created by the circle and the polyline.
Two smaller circles are then created at those intersections and the original polyline.
A new polyline is drawn between the two smaller circles and offset to both sides.
The larger and the new polyline are then deleted.
This routine works great. I'm just looking for advice on how to improve, simplify and/or clean it up a bit.
Any help would be much appreciated.
Thanks and have a great holiday season!
;Bore by length
(defun C:TN2 (/ na nab lastent1 lastent2 pt1 pt2 o s)
(vl-load-com)
(command "-layer" "s" "LAND_BORE" "")
(setq na (getint "\nTotal Bore Length : "))
(setq nab (/ na 2.0))
(prompt "\nSelect Circle Centerpoint")
(command "circle" "nea" pause nab)
(setq lastEnt1 (entlast))
(SETQ PT1 (GETPOINT "\nSelect 1st Point:"))
(COMMAND "Circle" PT1 "D" "3.6")
(COMMAND "CHPROP" "L" "" "C" "RED" "")
(SETQ PT2 (GETPOINT "\nSelect 2nd Point:"))
(COMMAND "Circle" PT2 "d" "3.6")
(COMMAND "CHPROP" "L" "" "C" "RED" "")
(command "pline" PT1 PT2 "")
(setq lastEnt2 (entlast))
(setq o 1.7999999)
(setq s (ssget "L" '((0 . "*LINE,CIRCLE,ARC,ELLIPSE"))))
(foreach v (list o (- o))
(vla-Offset (vlax-EName->vla-Object (ssname s 0)) v)
)
(COMMAND "ERASE" LASTENT1 "")
(COMMAND "ERASE" LASTENT2 "")
(princ)
)