Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lisp Help

0 REPLIES 0
Reply
Message 1 of 1
asarafrazi
215 Views, 0 Replies

Lisp Help

Hi, I made this Lisp but I need help to fix it, The Lisp is helping us to write Fractional Imperial and draw in metric but if we cancel the command middle of command in going to stay on Architectural units and I couldn't find a way to keep in metric all the time. bu if we are going to finish the command everything is going to be fine. That would be awesome if you guys can help me. I really appreciate it.

 

(defun C:PGCTRAV (/ point ds ds2 ds3 a d m s dec_deg)
(setvar "cmdecho" 0)

(if (setq POINT (getpoint "\nPick a Start Point:"))

(progn
(command "_line" point)
(while (> (getvar "CMDACTIVE") 0)
(if (and (setq a (getreal "\nBearing in Deg Mins Sec [DD.MMSS] : "))

(setvar "lunits" 4)
(Setq ds (getdist (getvar 'Lastpoint) "\nEnter the Distance: "))
(setvar "lunits" 2)
(setq ds2 (* ds 0.0254))
)
(progn
(setq d (fix a))
(setq m (fix (* 100 (- a d))))
(setq s (* 100 (- (* 100 (- a d)) m)))
(setq dec_deg (+ d (/ m 60.0) (/ s 3600.0)))
(command (strcat "@" (rtos ds2) "<" (angtos (angtof (rtos dec_deg 2 😎 1) 1 8)))
)
(command "")
)
)
)
)

(princ)
)

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report