Drawing Polylines with Custom Length Units

Drawing Polylines with Custom Length Units

CogoCody
Enthusiast Enthusiast
1,242 Views
4 Replies
Message 1 of 5

Drawing Polylines with Custom Length Units

CogoCody
Enthusiast
Enthusiast

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)
)

 

0 Likes
1,243 Views
4 Replies
Replies (4)
Message 2 of 5

vladimir_michl
Advisor
Advisor

This can be done but probably not so easily. How do you expect to enter the polyline vertices? By X,Y in relative(?) coordinates entered with those non-standard units? Or by entering just the distance and assuming the angle as specified by your mouse cursor ("direct distance")? Or prompting for the angle separately? Or using a combination?

Or something like the 3DPOLYC - see https://www.cadforum.cz/en/draw-3d-polyline-by-length-azimuth-slope-tip7329 ?

 

Vladimir Michl, www.arkance-systems.cz  -  www.cadforum.cz

 

0 Likes
Message 3 of 5

vladimir_michl
Advisor
Advisor
0 Likes
Message 4 of 5

CogoCody
Enthusiast
Enthusiast

The initial point would always be on the grid for the current UCS (either by x,y or picking where picking is most common). Any input that has a length entry would be relative to either the picked point or last node's location from a previous distance.

 

If I could have my cake and eat it too, I'd have the flexibility to either have direct distance or prompting for the angle. Understandably it's easier to pick one. The 2dpoly command you linked appears to get at the spirit of what I'm hoping to do. I'll see If I can't get that to work first as that would be much easier than making the command! I appreciate the call out to that command! 

0 Likes
Message 5 of 5

Suzanne_Leone
Participant
Participant

I wish I could access the Czech CAD forums from work 😞