Getting Direction Bearing in Lisp from a Line
How do I access this direction bearing information?
0
Comments
-
If you just want a quick tell me, use LIST and select line. Same with other objects.0
-
The (vla-get-angle) function returns it in radians. You'll have to convert it to degrees minutes seconds. There's probably a lisp function somewhere that does that. The (angtos) function, with 1 as the first optional argument, is supposed to convert radians to a text version of DMS format.
The (vlax-dump-object) function returns all of an object's VBA/ActiveX properties, which can all be used in the same way as the Angle property.
(defun c:DumpPM ()
(setq Ent1 (car (entsel)))
(setq VLname (vlax-ename->vla-object Ent1))
(vlax-dump-object VLname T)
)0 -
I'm a little late to the party, but angtos with option 4 works...
(angtos ANG 4) would return surveyor bearings for a number (ANG) in radians, as a string. Got to watch the basis of direction, though. Radians have 0 oriented "east" and run counterclockwise, so (angtos 0.0 4) returns "E" for EAST.
(angtos (/ PI 4) 4) returns "N 45d0'0\" E"0