5
35
38
初来乍到
使用道具 举报
28
130
126
初露锋芒
(defun c:SECTMARK ()(SETQ $PATH "C:/Documents and Settings/");CHANGE THIS TO THE PATH THAT YOU PASTE YOUR BLOCKS TO. CHEERS(SE-erro)(SE-quiet)(SE-init)(Get_mvs)(pick1)(ask1)(setq #loc #org) ; ### Bubble Point(make-pts1)(setvar "attdia" 0)(command "layer" "m" "TAGS" "" "insert" (strcat $PATH "Sec-ball") #loc DMS DMS "0" #sectno #drawno "insert" (strcat $PATH "Sec-arr") #loc (* -1 DMS) DMS (rtd #ang)); Arrow(setvar "attdia" 1)(setq TAIL "Sec-endB")(setq MIR nil)(setq MIR (getstring "\nFlip? Y/N <N>: "))(if (/= MIR "")(setq MIR (strcase (substr MIR 1 1))))(if (= MIR "Y")(progn(command "mirror" (entlast) "" #loc #2nd "y")(setq TAIL "Sec-endA")))(COMMAND "-INSERT" (strcat $PATH TAIL) "_r" (rtd (+ (* pi (/ 180 180)) #ang)) "_s" DMS #LOC )(COMMAND "UCS" "Z" (RTD #ANG))(SETVAR "ORTHOMODE" 1)(princ "\nSelect base point to move section tail from..")(COMMAND "MOVE" (ENTLAST) "" pause PAUSE)(COMMAND "UCS" "P")(SE-normal)(setq *error* olderror)(princ))(defun dtr (a) (* pi (/ a 180.0)))(defun rtd (a) (* 180.0 (/ a pi)))(defun SE-init ()(setq #45 (dtr 45) #90 (dtr 90) #135 (dtr 135) #180 (dtr 180) #225 (dtr 225) #270 (dtr 270) #315 (dtr 315)))(defun pick1 ()(setq #org nil #2nd nil #side nil)(while (= #org nil) (setq #org (getpoint "\nSelect Center point of Section Bubble: ")))(while (= #2nd nil) (setq #2nd (getpoint #org "\nRotation of Section mark?: ")) (if (= (getvar "orthomode") 0) (setq orno T) (setq orno nil) ))(setq #ang (angle #org #2nd))(setq #dist (distance #org #2nd)))(DEFUN Get_mvs ()(if (and (= (getvar "cvport") 1)(= (getvar "tilemode") 0)) ; if in Paperspace (setq dms 1) (if (= (getvar "tilemode") 0) ; if in Modelspace inside viewport (progn (vscl) (setq dms mvs) );progn (Try_Dimscale) );if);if);defun(defun ask1 ()(if #sectno (progn (setq #prevno #sectno) (setq #sectno (getstring (strcat "\nSection Number <" #prevno ">: "))) (if (= #sectno "")(setq #sectno #prevno)) ) (progn (setq #sectno (getstring "\nSection Number <1>: ")) (if (= #sectno "") (setq #sectno "1"))))(if #drawno (progn (setq #prevdrawno #drawno) (setq #drawno (getstring (strcat "\nDrawing Reference <" #prevdrawno ">: "))) (if (= #drawno "")(setq #drawno #prevdrawno)) ) (progn (setq #drawno (getstring "\nDrawing Reference <->: ")) (if (= #drawno "") (setq #drawno "-")) )))(defun make-pts1 ()(setq #bb1 (polar #loc (+ #ang #180) (* DMS 17.0)));; Bubble Centre(setq #tp2 (polar #loc (+ #ang #90) (* DMS 15.0))) ;; Text Left(setq #tp1 (polar #2nd (+ #ang #90) (* DMS 15.0))) ;; Text right(cond( (= #90 #ang)(setq #tang 0) )( (= #270 #ang)(setq #tang 0) )( (and (< #90 #ang)(> #270 #ang) )(setq #tang (+ #180 #ang)) )