Drawing Polylines with Custom Length Units
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm working on some quality-of-life commands, one of which is to make tracing old survey boundaries a little easier. My goal is to be able to run the polyline command but capture the user input while the Bearing Distance transparent command ('BD) is active and scale the distance by some umber (e.g. units of chains, rods, etc.).
I'm struggling to achieve that in a simple scenario. The idea below (to test it out) would be to use the polyline command to grab the first point, then have the second input be a distance where the polyline command implicitly grabs the bearing from the location of the cursor and repeat that until closing the command.
Understandably, the polyline command is complex and I'm sure I'm missing something. Any help on a solution for the above or troubleshooting below would be much appreciated. I know I'm struggling to effectively use the command and command-s functions to manipulate the timing of pline and grabbing user input.
;; RUNS THE POLYLINE COMMAND BUT ALLOWS INPUT OF VARIOUS LENGTH UNITS
(defun c:PCH (/ md dist cPt)
(initget 1 "Ft Ch")
(setq md (getkword " ENTER YOUR DISTANCE MODE (Ft or Ch) " ) )
(if (= md "Ft")
(command "_pline")
)
(if (= md "Ch")
;;(setq dist (getdist))
;;(setq scl (cvunit 'dist "chain" "ft") )
;;(setq cPt (getpoint "\nSpecify center point: ") )
;;(command "_pline")
;; want to scale distance input in pline by a conversion factor from cvunit
)
(princ)
)