Help! nofunction definition:RTD

Help! nofunction definition:RTD

Anonymous
Not applicable
1,473 Views
3 Replies
Message 1 of 4

Help! nofunction definition:RTD

Anonymous
Not applicable

I have always used this LISP. However, after installing 2018 map3D it will not work. Can anyone help me?

 


(defun C:LBRK ()
  (setq OLDCE (getvar "cmdecho"))
  (setq OLDERR *ERROR*)
  (setq os (getvar "osmode"))
  (setq scl (getvar "userr2"))
  (setvar "cmdecho" 1)
  (defun *ERROR* (errmes)
    (princ (strcat "\nExecution of LBRK halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *ERROR* OLDERR)
    (prin1)
  )
  ;(setq *ERROR* nil)
  ;to turn error handling off, erase the semicolon in the line above.
  (setq clay (getvar "CLAYER"))
  (setvar "CMDECHO" 0)
  (command "osnap" "nea")
  (setq INSPT (getpoint  "\npick insertion point for line break..."))
  (setq line (ssget inspt))
  (setq l1 (entget (ssname line 0)))
  (setq lay (cdr (assoc 8 l1)))
  (command "LAYER" "S" lay "")
  (setq ANG1 (getangle inspt "\npick rotation angle..."))
  (setq ANG2 (* (+ (rtd ang1) 360) -1))  ;*if survey units are used
; (setq ANG2 (rtd ang1))  ;*if ACAD units are used
  (command "circle" inspt (* 1.875 scl))
  (setq circl (entlast))
  (command "trim" circl "" inspt "" "erase" circl "" "insert" "linebrk" inspt scl scl ang2)
  (command "osnap" os)
  (command "LAYER" "S" clay "")
  (setvar "CMDECHO" OLDCE)
  (setq *ERROR* OLDERR)
  (prin1)
(princ)
)

0 Likes
1,474 Views
3 Replies
Replies (3)
Message 2 of 4

Ranjit_Singh
Advisor
Advisor

As the error reads, you are missing the rtd function. Add this to your lisp

(defun rtd (x)
(* 180.0 (/ x pi)))
0 Likes
Message 3 of 4

Anonymous
Not applicable

Thank you! Although it rotates 90 degrees to the line, not parallel with the line.....

0 Likes
Message 4 of 4

Ranjit_Singh
Advisor
Advisor

You should try to look for your original rtd function. I am just guessing at what it might contain.

0 Likes