Jump to content

Outdated Autocad Lisp Routines


Jasonx24

Recommended Posts

Hi All,

 

Kinda new here...

 

i have been using an outdated lisp in my 2013 autocad. it was working fine on autocad 2009 and 2010 as per seniors in or company. but when we updated 3 years ago problems started to arise. ex. loosing the snaps on all routines. commands not working. and eventually unusable on our latest 2014 version.

 

is there a way that i can update my lisp to work in autocad 2014?

 

Thank You

Link to comment
Share on other sites

  • 2 months later...

Hi All,

 

i have attached here in a screenshot of the error in Autocad 2014. i have also attached the actual attribute the command should show using Autocad 2013.

 

link of lisp file:

https://www.dropbox.com/s/vva5y7psu0iv2ue/CADSRV.rar?dl=0

 

im not familiar with lisp programming so i hope someone can help me out with the errors i'm having.

 

Thank You,

2013 AUTOCAD.jpg

2014 AUTOCAD.jpg

Link to comment
Share on other sites

The screenshot i showed is just one of many commands i have on my lisp routine file.

But as i have checked most of my commands comes out with an error on 2014 version.

 

Thank You

Link to comment
Share on other sites

The lisp file is already attached as a link... im having errors attaching my file maybe its to big. so i used my drop

box instead. to elaborate on my problem. i use the lisp to generate codes (attributes) for the design of formworks on

structures, so basically it assigns attributes to a specific size of formwork. based on my attached screenshot. i used

a rectangle sized 600 x 1400 mm. so when i want to attach an attribute to this i use of the commands on the lisp

depending on what i want the attribute to be. on the screen shot since the size is for slab form i used the command

SP. the lisp gives and instruction to click the top left corner. and next instruction is to click the bottom right

corner. after that the lisp will generate an attribute like "600 SP 1400". this was fine 2013 and below versions.

comes 2014 doing the same procedures. now the lisp will give an attribute of "S1". lisp will give the same set of

instructions but after clicking the bottom right corner it will now show unknown command "600 SP 1400".

2014 AUTOCAD2.jpg

Link to comment
Share on other sites

I would guess that is about a call of a command whose syntax had changed in release 2014. To track it down may enable the echo of prompts by locating in you code the statement below:

(setvar "CMDECHO" 0)

and changing it to:

(setvar "CMDECHO" [b][color=magenta]1[/color][/b])

After call again the tool and check on which command call it fails; adjust it by the new prompts or evaluate the usage of INITCOMMANDVERSION function.

 

 

PS. By the way, perform the search for CMDECHO only since the syntax of said assignment may vary.

Link to comment
Share on other sites

Load your code into VLIDE it has a break on error so you can see where it stops. www.lee-mac.com has a tutorial on how to use VLIDE worth reading. The other way I do it is to put (princ "wow") code (princ "wow2") and just look at the screen and see what number I get to, the error is between wow1 & wow2 keep moving these princ's.

Link to comment
Share on other sites

I already instructed you on how to post your code directly here by pasting the actual code (not the .lsp file) in between the tags created when you click on the #.

 

PAST YOUR CODE BETWEEN [COD E][/COD E] 

So it shows here

Link to comment
Share on other sites

10Mb is massive for a lisp it must be made up of a whole lot of defuns maybe look at posting the code starting at the lisp that is not working look for C:something, if multiple routines are not working then its common problem to multiple defuns.

Link to comment
Share on other sites

yes exactly its made up of a lot of lisp routines related to one another. best guess is no one lisp file stands alone. my autocad is directed to a specific folder that contains all the lisp file for the process and it contains the support blocks and lisp aswell.

 

;; Initial Formwork CODES
;; FC=FORMCODE BB=BEAMBOTTOM         SHeeT/PaNaL/FILler  Head
(setq     FC_BBSHT    "BB"        FC_BBPNL    "BP"
   FC_BBFIL    "BF" 
   FC_BH        "BH"        FC_CH        "CH"

   FC_BV    "BV"     FC_BS    "BS"

   FC_WP    "WP"    FC_WT    "WT"    FC_W1    "W1"
   FC_WH    "WH"    FC_WF    "WF"
   FC_WPF    "WPF"    FC_WE    "WE"
   FC_WX    "WX"    FC_K    "K"        

   FC_CJ    "CJ"    FC_CT    "CT"    FC_CB "CB"    FC_CX    "CX"

   FC_SP    "SP"    FC_SF    "SF"    FC_SJ    "SJ"    FC_SC    "SC"    FC_SX    "SX"
   FC_LH    "LH"    FC_LS    "LS"    FC_LM    "LM"

   FC_UC    "UC"    


)


(defun c:WH () (load (strcat LIB     "WALL-HT" )) (c:WH ))
(defun c:BD () (load (strcat LIB     "BSIDE_TX")) (c:BD ))
(defun c:TA () (load (strcat LIBlsp     "SP-AREA" )) (c:TA ))
(defun c:SA () (load (strcat LIBlsp     "SP-AREA" )) (c:SA ))
(defun c:TSA() (load (strcat LIBlsp     "SP-AREA" )) (c:TSA))
(defun C:WS () (load (strcat LIBlsp     "WL-SPEC" )) (C:WS ))
(defun C:SWE() (load (strcat LIBlsp     "WALLAUTO")) (C:SWE))
(defun C:BP () (load (strcat LIBlsp     "BmBOTTOM")) (C:BP ))
(defun c:BB () (load (strcat LIBlsp    "BmBOTTOM")) (c:BB ))
(defun c:SWC () (load (strcat LIBlsp    "W_COLauto")) (c:SWC ))

(setq     WCL  (strcat LIBblk "-W_C_L")    WCL3r (strcat LIBblk "-W_C_L3r")
     __L  (strcat LIBblk "-____L")   WCL2r (strcat LIBblk "-W_C_L2r")
     W__  (strcat LIBblk "-W____")     4WH   (strcat LIBblk "_4WH" )
   _CL  (strcat LIBblk "-__C_L")   WH    (strcat LIBblk "_WH"  )
   WC_  (strcat LIBblk "-W_C__")    WCLC  (strcat LIBblk "-WCL" )
   _STD (strcat LIBblk "-STD"  )    WALL1 (strcat LIBblk "wall1") )

;(defun INFO (/ x Dx y Dy P1 P2 P3 P4 M Md1 Md2 DeltaY DeltaX) 
(defun INFO ()  
       (setq m:err *error* *error* *merrmsg*)
       (command "layer" "M" WLY "")
       (setvar "cmdecho" 0) (setvar "osmode" 33) (graphscr)
       (command "APERTURE" "10")
       (setq P1 (getpoint    "\n Pick Top Left corner  :")
        P3 (getpoint P1 "\n Pick Bottom  Right cornner  :")
       P4 (list (car P3) (cadr P1) (caddr P3) )
       P2 (list (car P1) (cadr P3) (caddr P1) )
       M  (mapcar '/ (mapcar  '+ P1 P3) '(2 2) )
       Md1 (mapcar '+ P2 '(0 -100) )
       Md2 (mapcar '+  M '(0 -200) )
       Dy  (fix (+ (distance P1 P2) 0.5))
       Dx  (fix (+ (distance P2 P3) 0.5))
       x Dx y Dy 
       DeltaY (distance P1 P2)
       DeltaX (distance P2 P3) )
   (ORGL))

;(defun MINFO (/ P5 P5a P5b P6 P6a P6b) (INFO)
(defun MINFO () (INFO)
(setq  P5 (mapcar '+ P2 '(0 100))  P6 (mapcar '+ P3 '(0 100))
    P5a(mapcar '+ P2 '(0 50))   P6a(mapcar '+ P3 '(0 50))
    P5b(mapcar '+ P2 '(100 50)) P6b(mapcar '+ P3 '(-100 50))
    P7 (mapcar '- P1 '(0 125))  P8 (mapcar '- P4 '(0 125))
    P9 (mapcar '+ P2 '(100 0))  P10(mapcar '+ P7 '(100 0))
    P11(mapcar '- P3 '(100 0))  P12(mapcar '- P8 '(100 0))
    K1 (mapcar '+ P1 '(0 50))   K2 (mapcar '+ P4 '(0 50))
    K3 (mapcar '- P1 '(0 75))   K4 (mapcar '- P4 '(0 75))
    K5 (mapcar '- P2 '(0 75))   K6 (mapcar '- P3 '(0 75))
    WT1(mapcar '+ P2 '(0 2100)) WT2(mapcar '+ P3 '(0 2100)))
);e_MINFO

;Draw Kickers...
;===============
(defun C:DK () (MINFO) (command "layer" "m" "COM"""
               "line" P1 K1 K2 """line" K3 K4 ""
               "line" P2 K5 K6 """line" P5a P6a ""
               "layer" "M" "$BM" "C" 6"" "" "line" P1 P4""
               "line" P2 P3 "" ))

;181196 rearrange common tasks.
(defun show_COMcode ()
   (setq STR (STRCAT "          <<< Component Code = "
       (itoa X) " " CC " " (itoa Y) " >>>  " ) )
       (princ "\n ")(prompt STR) (princ)
)

(defun PANEL ()
(if (< x y) (setq R 90) (setq R 0))
 (cond    ((or  (> x 500)(> y 500))     (setq BLK WCL))
   ((and (< y 220)(> x 149))      (setq BLK WCL2r R 0))
   ((and (> 499 y 219)(> x 149))     (setq BLK WCL3r R 0))
   ((and (< y 176)(< x 201))     (setq BLK W__   R 0))
   ((and (< y 176)(> 301 x 200))      (setq BLK WC_))
   ((and (> x  0)(> y  0))          (setq BLK WCL))   );eCond
)

(defun INSANG () (if (> y x) (setq R 90)(setq R 0)    ))

(defun FILL ()     (if (or (> Dx 300)(> Dy 300))(setq BLK WCL)(setq BLK W__ ))
       (if (> Dx Dy) (setq R  0 x Dy y Dx)
                 (setq R 90 x Dx y Dy)))

(defun INSBM () (command "insert" BLK m "" "" R "" "" x CC y "1"))

(defun IN-SC () (command "insert" BLK m "" "" R x CC y)
       (show_COMcode) )

(defun IN-WCL ()(command "insert" BLK m 1 1 R x CC y)
        (show_COMcode) )

;181196-revised for BS and WT, 011296 fix X & Y
;(defun IN-BS () 
;    (command "insert" _STD m 1 1 R (strcat  (itoa y) " " cc " " (itoa x)) )
;    (show_COMcode) ) 

(defun IN-BS () 
   (setq y (itoa dx) x (itoa dy))
   (command "insert" _STD m 1 1 R (strcat  x " " cc " " y) )
   (setq STR (STRCAT "<<<<<<<<  Component Code >>>>>>>> "
       "                    " x " " CC " " y))
       (princ "\n ")(prompt STR) (princ) ) 


(defun IN-PANEL ()
(if (< x y) (setq R 90) (setq R 0))
 (cond    ((or  (> x 500)(> y 500))     (IN-ONE))
   ((and (< y 220)(> x 149))      (progn (setq BLK WCL2r R 0) (IN-WCL)))
   ((and (> 499 y 219)(> x 149))     (progn (setq BLK WCL3r R 0) (IN-WCL)))
   ((and (< y 176)(< x 201))     (progn (setq BLK W__   R 0) (IN-WCL)))
   ((and (< y 176)(> 301 x 200))      (progn (setq BLK WC_   R 0) (IN-WCL)))
   ((and (> x  0)(> y  0))          (IN-ONE))     );eCond
)


(defun ICATT () (command "layer" "m" "CCW" "c" 3"""")
       (setq X (fix (+ (distance Pb Pc) 0.5)))
       (if (> Y 199) (setq R 90) (setq R 0))
       (if (or (= X 65)(= X 66)(= X 100)) (setq X " " M  (mapcar '+ M '(0 -90)))    )
       (if (> 199 Y 226) (setq IBLK _CL) (setq IBLK WCL))
       (COMMAND "insert" IBLK M """" R X CC Y)                 )


;for AB input in BmBttom.lsp, 161196
(defun IN-_CL ()
   (command "insert" _STD m 1 1 R (strcat  cc " " (itoa y)) )
   (setq STR (STRCAT "<<<<<<<< Component Code >>>>>>>> "
       "                    " CC " " (itoa Y)))
   (princ "\n ")(prompt STR) (princ)) 

(defun IN-ONE ()
   (command "insert" _STD m 1 1 R (strcat  (itoa x) " " cc " " (itoa y)) )
   (show_COMcode)) 
   
(defun IN-HOR () (command "insert" BLK m "" "" 0 x CC y))

(defun AUTIN () (setq   M  (mapcar '/ (mapcar  '+ Pa Pc) '(2 2) )
           Pb (list (car Pa) (cadr Pc) )
           Y  (fix (+ (distance Pa Pb) 0.5))
           X  (fix (+ (distance Pb Pc) 0.5))    )
       (ORGL)  )
               
(defun c:SBE () (MINFO) (PANEL)
(command "undo" "BE")
(progn (setq CC "CB")
   (command "layer" "m" "COM" "")
   (command "line" P7 P8 """line" P9 P10 """line" P11 P12 "")
   (setq Pa P7  Pc P9) (AUTIN) (ICATT)
   (setq Pa P12 Pc P3) (AUTIN) (ICATT)     )
(command "undo" "E")
)

(defun c:WD1 () (MINFO) (PANEL)(setq y (- y 225))
   (progn
   (command "layer" "m" "COM""" "line" P5 P6 "" "line" P7 P8
        "" "layer""m" "CCW""")
   (command "insert" 4WH (mapcar '/ (mapcar '+ p5 p3) '(2 2))
        """" 0 100 "WH" x)
   (command "insert" BLK (mapcar '/ (mapcar '+ p7 p6) '(2 2))
        """" R  x "WX" y)
   (setq x (+ x 132))
   (command "insert" BLK (mapcar '/ (mapcar '+ p1 p8) '(2 2))
        """" 0 " " "NC" x)     )       );eWD1

(defun INSMPT () (setq M (mapcar '/ (mapcar '+ TLP BRP) '(2 2))   ))

(defun DOOR () (MINFO) (PANEL)
(if (> x 175)
(Progn (setq y (- y 175))
 (command "layer" "m" "COM"""
      "line" P5a P6a "" "line" P7 P8 "" "layer" "m" "CCW""")
 (setq TLP P5a BRP P3) (command "insert" WH  (INSMPT) """" 0 50 "PV" x)
 (setq TLP P7  BRP P6) (command "insert" BLK (INSMPT) """" R   x CC y)
 (setq TLP P1  BRP P8 x (+ x 132))
       (command "insert" BLK (INSMPT) """" 0 " " "CN" x)  )

(Progn (setq y (- y 125)) 
 (command "layer" "m" "COM""" "line" P7 P8 "" "layer" "m" "CCW""")
 (setq TLP P7 BRP P3)  (command "insert" BLK (INSMPT) """" R  x CC y)
 (setq TLP P1 BRP P8 x (+ x 132))
           (command "insert" BLK (INSMPT) """" 0 " " "CN" x)
))) ;eDR        
;(defun C () (setq CC "WE")(DOOR))
;(defun C:WD () (setq CC "WX")(DOOR))

(defun C:WR () (setq WLY "CCw") (MINFO) (PANEL)
(setq TLP P1  BRP P6a CC FC_WP y (- y 50)) (INSMPT)(SETVAR "clayer" "CCw")
 (if (AND (= x 600)(= y 2050)) (PROGN(setq WLY "CCw1" STR "W1")(IN-SLAB))
       (IN-ONE))
 (setq TLP P5a BRP P3  CC "WH")
 (SETVAR "clayer" "CCV") 
 (command "insert" WH (INSMPT) """" 0 50 CC x)
)

;Input Small Window panel as elev. 050994
;==================================
(defun C:SW ()  (MINFO) (command "_layer" "M" "COM" "" "")
       (setq   M (mapcar '+ '(0 150) m)
       x (getint "\n\t Enter wall thickness in mm")
       x (+ x 132) n 0 R 0    
       rad1 (angle p1 p2) rad2 (angle p1 p4)
       p1a (polar p1 rad2 25)
       p4a (mapcar '+ p4 '(-25 0))
       p1b (mapcar '+ p1 '( 25 -25))
       p4b (mapcar '+ p4 '(-25 -25))
       p2a (mapcar '+ p2 '(25  0))
       p2b (mapcar '+ p2 '(25 25))
       p3a (mapcar '+ p3 '(-25 0))
       p3b (mapcar '+ p3 '(-25 25))    )

(command "_line" p1b p4b "" "_line" p1a p2a ""
    "_line" P4a p3a "" "_line" p2b p3b ""     
    "_layer" "M" "VOID" "" "lt" "CENTER" "" "" ""
    "_line" p1b p3b "" "_line" p2b p4b ""
    "_layer" "M" "CCW" "" "")

(while (< n 4)  
 (cond ((= n 0)(setq CC "VT" y dx))
   ((= n 1)(setq CC "VL" y dy M (mapcar '+ '(0 -100) m)))
   ((= n 2)(setq CC "VR"      M (mapcar '+ '(0 -100) m)))
   ((= n 3)(setq CC "VB" y dx M (mapcar '+ '(0 -100) m)))    );eCOND
 (setq n(1+ n))
 (command "_insert" WCLC M """" R x CC y)
))

;******************************************************************************
;#WALL ELEV.
;===========
;980820 checker WT
;(defun chkWT () 
;(if (< DY 200) (command "vslide" (strcat LIBsld "std-wt"))
)

;(defun C:WT ()  (setq CC "WT" WLY "CCWt") (INFO) (chkWT) (IN-PANEL))
;=================================================
;980824 WT revised with checker
(defun chkWT () 
(if (and (>= DY 200) 
    (or(= DY 200)
   (= DY 225)
   (= DY 250)     
   (= DY 300)
   (= DY 425)
   (= DY 475)
   (= DY 575)
   (= DY 675)
   (= DY 825)) )
(IN-PANEL)
(command "vslide" (strcat LIBsld "std-wt"))
))

(defun C:WT ()  (setq CC FC_WT WLY "CCwt") (INFO) (chkWT))


;(defun C:WA ()  (setq CC "WP" WLY "CCwp") (INFO)
;        (if (AND (= x 600)(= y 2050)) (PROGN(setq STR "VP1")(IN-SLAB))
;
;                              (IN-PANEL))    )

;01712-Combine Vertical Panel Commands to [WA] for WP,WPA,WPK
;=====
(defun C:WA ()  (setq CC FC_WP WLY "CCwp") (INFO)
 (cond ((AND (< x 199)(= y 2100)) (PROGN (setq WLY "CCwpf" CC FC_WPF)(IN-PANEL)) )
       ((AND (= x 600)(= y 2050)) (PROGN (setq WLY "CCwp1" STR FC_W1)(IN-SLAB)) )
       ((OR  (> Y 0) (> X 0))      (IN-PANEL))
 ) ;eCOND
)


(defun C:WE ()     (setq CC "WE" WLY "CCWe") (INFO) 
       (if (AND (= x 600)(= y 2050)) (PROGN(setq STR "V1E")(IN-SLAB))
                             (IN-PANEL))    )

(defun C:WX ()     (setq CC FC_WX WLY "CCwx")  (INFO) (IN-PANEL))
(defun C:WT ()     (setq CC FC_WT WLY "CCwt")  (INFO) (IN-PANEL))
(defun C:WK ()     (setq CC "WK" WLY "CCwk")  (INFO) (IN-BS))

;FILLERS
;==============================
(defun wallFiller ()  (setq CC FC_WA WLY "CCwf") (INFO)
         (if (AND (= x 600)(= y 2050)) (PROGN(setq WLY "CCWpk" STR "WPK")(IN-SLAB))
                             (IN-PANEL))    )
   (defun C:VAF () (wallFiller))
   (defun C:WAF () (wallFiller))
   (defun C:VPA () (wallFiller))



;(defun C:DP ()     (setq CC "DP" WLY "CCWdp") (INFO) (FILL)
; (setq Y (+ 0 y))                        ;230395 DROPPER  
;  (IN-ONE))                               ;141196 removed +20  

(defun C:UX () (setq WLY "CCSux" CC "UX")  (INFO) (FILL)
(setq Y (- y 20))                        ;300597 HK project 
 (IN-ONE))                             ;UX total width -20

(defun C:WF () (setq WLY "CCwt") (INFO)
  (if (< x y)
    (PROGN(setq CC FC_WT)(PANEL)(IN-ONE))
    (PROGN 
   (if (<= x 600) (setq BLK W__) )
   (setq x Dy y Dx CC FC_WF)
   (if (> Dx Dy) (setq R 0 x Dy y Dx) (setq R 90 x Dx y Dy))
   (IN-WCL)
    )
))    

(defun C:TB () (setq CC "TB" WLY "CCWTB") (INFO) (FILL)(IN-ONE))
(defun C:BX () (setq CC "BX" WLY "CCBX") (INFO) (FILL)(IN-ONE))
(defun C:BPP() (setq CC "BP" WLY "CCBP") (INFO) (FILL)(IN-ONE))
(defun C:BR () (command "vslide" (strcat LIBsld "B-SUPDED") ))
(defun C:BL () (command "vslide" (strcat LIBsld "B-SUPDED") ))

(DEFUN C:SCL() (INFO)(FILL)(setq x (GETINT "\n Enter LEFT length : ") CC "SC")(IN-WCL))
(DEFUN C:SCR() (INFO)(FILL)(setq x y y (GETINT "\n Enter RIGHT length : ") CC "SC")(IN-WCL))

(defun C:BS () (setq WLY "CCBS")(INFO)
  (cond ((< x 176) (progn (setq CC FC_BV BLK WC_) (FILL) (IN-WCL))    ) 
     ((< 0 x  ) (progn (setq CC FC_BS )        (PANEL)(IN-BS))    )
    )            
)

;------------------------------------------------------------------------------
(defun C:HL () (INFO) (setq x Dy y Dx R "0" CC "WH")
(IF (= x 100)   (setq BLK (strcat LIBsym "4WH")) (setq BLK WH))
(command "Layer" "m" "CCWH""") (IN-WCL)
)
;------------------------------------------------------------------------------
(defun INS-CN () (setq BLK WCL WLY "CCWN" x Dy)
 (cond ((= x 175) (progn(setq CC (strcat PRCD "E") x " " M (mapcar '+ M '(-93 0))) (IN-HOR)))
   ((= x 150) (progn(setq CC (strcat PRCD "D") x " " M (mapcar '+ M '(-93 0))) (IN-HOR)))
   ((= x 125) (progn(setq CC (strcat PRCD "C") x " " M (mapcar '+ M '(-93 0))) (IN-HOR)))
   ((= x 100) (progn(setq CC (strcat PRCD "B") x " " M (mapcar '+ M '(-93 0))) (IN-HOR)))
   ((= x  75) (progn(setq CC (strcat PRCD "A") x " " M (mapcar '+ M '(-93 0))) (IN-HOR)))))

(DEFUN C:CN () (INFO) (setq PRCD  "N" y Dx) (INS-CN))
(DEFUN C:BC () (INFO) (setq PRCD "BC" y Dx) (INS-CN))
(DEFUN C:C1 () (INFO) (setq y (+ Dx 66) ) (INS-CN))
(DEFUN C:C2 () (INFO) (setq y (+ Dx 132)) (INS-CN))

(DEFUN C:SX1() (INFO) (setq x Dy y Dx CC "SX")
(if (= x 100) (setq x "25" M (mapcar '+ M '(-60 0)))) (IN-HOR))
(DEFUN C:SX2() (INFO) (setq x Dy y Dx CC "SX")
(if (= x 100) (setq x "50" M (mapcar '+ M '(-60 0)))) (IN-HOR))

;------------------------------------------------------------------------------
(DEFUN KICKER() (INFO) (setq BLK WCL WLY "CCWK" x Dy y Dx R "0" CC "K"))

(DEFUN C:KI () (KICKER)
(COND  ( (and (> x 200)(> y 500)) (IN-ONE))
   ( (< x 200)  (progn (IF (> y 500) (setq M (mapcar '+ M '(0 -150)))
                              (setq M (mapcar '+ M '(0 -200)) BLK WCL2r))
            (IN-WCL)))        
);eCOND

);eKI

;Top kicker
(DEFUN C:KU () (KICKER)
 (IF (> y 500) (progn (setq M (mapcar '+ M '(0 150))) (IN-ONE))
       (progn (setq M (mapcar '+ M '(0 200)) BLK WCL2r) (IN-WCL) )) )

;------------------------------------------------------------------------------
;#SLAB(DECK)
;===========
(defun GET-TXT  () (if (> Dx Dy) (setq R 0 x Dy y Dx) (setq R 90 x Dx y Dy))
          (setq STR (strcat (itoa X) " " CC " " (itoa Y))))

(defun INS-DSTD () (command "layer" "M" WLY "")
          (command "insert" (strcat LIBblk "D-STD") M """" R STR) )

;set working layer(WLY)
(defun IN-SLAB () (command "layer" "M" WLY "")    
         (command "insert" (strcat LIBblk "SLAB-STD") M """" R STR) )

(DEFUN SLAB () (COND  ((< y 451) (progn (setq BLK W__)    (IN-WCL)))
       ((AND (= x 450)(= y 1400)) (setq STR "S1")(IN-SLAB))
       ((AND (= x 450)(= y 1100)) (setq STR "S2")(IN-SLAB))
       ((AND (= x 450) (= y 950)) (setq STR "S3")(IN-SLAB))
       ((AND (= x 450) (= y 800)) (setq STR "S4")(IN-SLAB))
       ((> x 1)(progn (command "layer" "M" WLY "")(IN-ONE))    )    ));eSLAB
             
(DEFUN C:DE () (INFO)(FILL)(setq WLY "CCD") 
       (if (< x 176)(setq CC FC_SF)
                    (setq CC FC_SP)) 
       (GET-TXT)(SLAB))
(DEFUN C:SP () (INFO)(FILL)(setq WLY "CCD") (if (< x 176)(setq CC FC_SF)
                            (setq CC FC_SP)) (GET-TXT)(IN-ONE))

(defun C:SF ()     (INFO)(FILL)(setq CC FC_SF WLY "CCD") (IN-ONE))



(defun INPT1 () (setq Iph (mapcar '- M '(90 0))
             Ipv (mapcar '- M '(0 90)))
(if (< dy dx) (setq M Iph x dy y dx R 0) (setq M Ipv x dx y dy R 90))
(if (or (= dx 100) (= dy 100)) (setq x ""))
(IN-WCL))

(DEFUN SJMENU ()(command "layer" "M" WLY "")
       (menucmd "S=X")(menucmd "S=SLABJT")
       (INFO)   (if (> Dx Dy) (setq R 0 x Dy y Dx)
                      (setq R 90 x Dx y Dy))
       (if (or(= x 125)(= x 100)(< x 67))
           (progn (setq STR (strcat CC " " (itoa Y))) (INS-DSTD))
           (IN-ONE))    )

(defun C:SJ () (setq WLY "CCSsj" CC "SJ")   (SJMENU) )
(defun C:UJ () (setq WLY "CCSuj" CC "UJ")   (SJMENU) )
(defun C:URJ() (setq WLY "CCBurj" CC "URJ")  (SJMENU) )
(defun C:TFH() (INFO)(FILL) (setq WLY "CCWtfh" CC "TFH" STR (strcat CC " " (itoa Y))) (INS-DSTD) )

(defun C:KJ () (setq WLY "CCSkj" CC "KJX") (SJMENU) )

(defun C:SJB() (setq WLY "CCSsjb" CC "SJB") (SJMENU) )
(defun C:UJB() (setq WLY "CCSujb" CC "UJB") (SJMENU) )

(defun C:BJ () (command "vslide" (strcat LIBsld "B-SUPDED") ))
(defun C:BJB() (command "vslide" (strcat LIBsld "B-SUPDED") ))
(defun C:LM () (setq WLY "CCSlm" CC FC_LM)  (SJMENU) )
(defun C:LS () (setq WLY "CCSls" CC FC_LS)  (SJMENU) )
(defun C:LX () (setq WLY "CCSlx" CC FC_LX)  (SJMENU) )

(defun IN-STD () (setq STR (strcat X " " CC " " (itoa Y)))
          (command "insert" _STD M """" R STR))

(defun C:SJ7() (INFO)(FILL) (setq WLY "CCSsj075" X  "75" CC "CJ") (IN-STD))
(defun C:SJ1() (INFO)(FILL) (setq WLY "CCSsj100" X "100" CC "CJ") (IN-STD))  
 
;=============================================
;2001306 CJX-Vertical Joint Commands
;============================================
(defun C:CJ () (setq WLY "CCWcj" CC "CJ")   (SJMENU))
(defun C:CJJ() (setq WLY "CCWc_r" CC "CJR") (SJMENU))
(defun C:CCJ() (setq WLY "CCWc_l" CC "CJL") (SJMENU))
(defun C:EA () (setq WLY "CCWae" CC "AE")   (SJMENU))

;;20040814-Standardized CJ/AE <200; AT,AX,CB,CT,CX min 200 and above
(DEFUN Ai_CJ () (command "layer" "M" WLY "") (INFO)   
   (if (> Dx Dy) (setq R 0 x Dy y Dx)
             (setq R 90 x Dx y Dy))
   (if (or(= y 175)(= y 150)(= y 125)(= y 100)) (setq CCCA CCc) (setq CCCA CC))
   (if (or(= x 125)(= x 100)(< x 67))
    (progn (setq STR (strcat CCCA (itoa Y))) (INS-DSTD))
    (IN-ONE)
   )
)

(defun C:CT () (setq WLY "CCWct" CC "CT " CCc "CJ")  (Ai_CJ))
(defun C:CX () (setq WLY "CCWcx" CC "CX " CCc "CJ")  (Ai_CJ))
(defun C:CB () (setq WLY "CCWcb" CC "CB " CCc "CJ")  (Ai_CJ))
(defun C:AX () (setq WLY "CCWax" CC "AX " CCc "AE")  (Ai_CJ))
(defun C:AT () (setq WLY "CCWat" CC "AT " CCc "AE")  (Ai_CJ))
(defun C:CTT() (setq WLY "CCWc_r" CC "CTR " CCc "CJR")  (Ai_CJ))
(defun C:CCT() (setq WLY "CCWc_l" CC "CTL " CCc "CJL")  (Ai_CJ))
(defun C:CBB() (setq WLY "CCWc_r" CC "CBR " CCc "CJR")  (Ai_CJ))
(defun C:CCB() (setq WLY "CCWc_l" CC "CBL " CCc "CJL")  (Ai_CJ))
(defun C:CXX() (setq WLY "CCWc_r" CC "CXR " CCc "CJR")  (Ai_CJ))
(defun C:CCX() (setq WLY "CCWc_l" CC "CXL " CCc "CJL")  (Ai_CJ))

(defun U_ANGLE () (INFO) (setq Pa P1 Pc P3 CC "AB") (AUTIN)
   (command "layer" "m" "CCB" "c" 3"""")
   (if (or (= X 65)(= X 66)(= X 70)(= X 100)) (setq X 0 )    )
   (FILL) (IN-_CL)                 )
(defun C:BA () (U_ANGLE))
(defun C:AB () (U_ANGLE))


(defun C:TM () (INFO) (command "Dtext" "S" 2 "M" m ))
;------------------------------------------------------------------------------
;Input data in text format i.e. CJ
;=================================
(defun ICTXT () (command "layer" "m" "TXT" "c" 144"""")
       (setq X (fix (+ (distance Pb Pc) 0.5)))
       (if (> Y 199) (setq R 90) (setq R 0))

(if (= X 100) (setq STR (STRCAT CC " " (itoa Y)))
        (if (> 199 Y 226) (setq STR (STRCAT (itoa X) CC  (itoa Y)))
                  (setq STR (STRCAT (itoa X) " " CC " " (itoa Y))) ) )
(setvar "osmode" 0) (COMMAND "TEXT" "S" "2" "M" M R STR))

(defun C:tC () (INFO) (setq Pa P1 Pc P3 CC  "CJ") (AUTIN) (ICTXT))
(defun C:tCR() (INFO) (setq Pa P1 Pc P3 CC "CJR") (AUTIN) (ICTXT))
(defun C:tCL() (INFO) (setq Pa P1 Pc P3 CC "CJL") (AUTIN) (ICTXT))


;ODDS
(defun C:ANG () (setq WLY "CCAng" CC "ANG")   (SJMENU) )

;------------------------------------------------------------------------------
(defun STRT () (MINFO)
(progn
  (setq C1 (mapcar '+ p2 '(100 100)))  (setq C2 (mapcar  '- p1 '(-100 100)))
  (setq C3 (mapcar '- p4 '(100 100)))  (setq C4 (mapcar  '- p3 '(100 -100))) )
)

(defun C:SDE () (setq BL1 (strcat LIB "F_SC")) (STRT)
;--
 (progn (setq     v1 (* (/(- dx 200) 450) (/(- dy 200) 1500))
       v2 (* (/(- dy 200) 450) (/(- dx 200) 1500))
       Qmx(itoa (max v1 v2))
       Qmi(itoa (min v1 v2))
       Descript (strcat "[ "Qmx " ] or " Qmi " xS1 for the other direction!" )
        )

(command "undo" "BE")
 (if (or (> x 3000) (> y 3000))
   (progn (command "text" "s" "STANDARD" "m" Md2 100 0  Descript)
      (if (> v1 v2) 
       (command ".insert" (strcat LIBblk "s_ver") M 1 1 0 "")
       (command ".insert" (strcat LIBblk "s_hor") M 1 1 0 "")))
   ); eif

(command "Layer" "M" "CCDsc" "" "insert" BL1 p2 1 1 90 "explode" "l"
                    "insert" BL1 p1 1 1 0 "explode" "l"
                    "insert" BL1 p4 1 1 270 "explode" "l"
                    "insert" BL1 p3 1 1 180 "explode" "l"
    "Layer" "M" "COM" ""  "Line" C1 C2 C3 C4 C1 ""))

(command "undo" "E"))
;eSDE

;===============================
(defun C:SWA () (setq BL1 (strcat LIB "CJ100")) (STRT)
(command "undo" "BE")
(command "Layer" "M" "CCM" ""     "insert" BL1 p2 1 1 90  "insert" BL1 p1 1 1 0
                    "insert" BL1 p4 1 1 270 "insert" BL1 p3 1 1 180
    "Layer" "M" "COM" ""  "Line" C1 C2 C3 C4 C1 "")
(command "undo" "E")) ;endSDE

;--

(defun DRW ()   (setq P1 (mapcar '+ P1 LEFT) 
             P2 (mapcar '+ P3 RIGH))
       (command ".LINE" P1 P2 "" ".CHPROP" "L""" "P" "la" "COM"""))


(defun C:MS () (command "layer" "M" "CCM""" )(menucmd "S=MISC"))
(defun C:CE () (command "insert" (strcat LIBblk "b_EXTC") "inter,endp" pause """" 
           "near" pause "explode" "L"))
(defun C:CI () (command "insert" (strcat LIBblk "b_INTC") "inter,endp" pause """"
           "near" pause "explode" "L"))

(defun C:PLT () (MINFO) (progn (command "Layer" "M" "HT" ""  "Line" P1 P3 "")
           (command "Line" P2 P4 "" "Layer" "m" "-CODE""")
           (setq CC (STRCAT (itoa X) "x" (itoa Y)))
           (command "insert" (strcat LIB "plate") m "" "" 0 CC)
           (command "move" "L""" m pause "dim1" "leader" m)
       ))

(defun C:TMB () (MINFO) (progn (command "Layer" "M" "HT" ""  "Line" P1 P3 "")
           (command "Line" P2 P4 "" "Layer" "m" "-CODE""")
           (setq CC (STRCAT (itoa X) "x" (itoa Y)))
           (command "insert" (strcat LIB "timber") m "" "" 0 CC)
           (command "move" "L""" m pause "dim1" "leader" m)
       ))



;Drawing "BJ" elevation outline
;==============================24/07/93
    (defun DCC () (INFO) (setq R_deg 57.29577951        CCang (angle P1 P3)
               D090 (rtos (*(+ CCang 1.570796327) R_deg) 2)
               D180 (rtos (*(+ CCang 3.141592654) R_deg) 2)
               D270 (rtos (*(+ CCang 4.71238898)  R_deg) 2)
               CCdist (rtos (+ (distance P1 P3) Len) 2)
               CCdeg  (rtos (* CCang R_deg) 2)
               P3a (strcat "@" Pro "<"  CCdeg)
               P3b (strcat "@125<" D270)
               P1b (strcat "@" CCdist "<"  D180)
               P1a (strcat "@125<" D090))
   (setvar "clayer" "COM") (command "pline" P3 P3a P3b P1b P1a P1 ""))

(defun C:DCN () (setq Pro "66"  Len 132) (DCC))
(defun C:DC1 () (setq Pro "100" Len 200) (DCC))

;4826 programme for auto input "CC", CEILING CORNER                                                ,260894
;8714 revised to share "Hcorner" for "CC" & "CL"
;8723 Add 13, 25 * 50 corners CCX,Y,Z   
;==================================================================================================
(defun Hcorner () (command "_layer" "M" WLY "") (graphscr) (setvar "osmode" 33)
 (setq p0 (getpoint "\nFrom Left to Right ,pick point")
   p1 (getpoint "\nNext point")         p2 (getpoint "\Last point")
   X (fix (+ (distance p0 p1) C100X))    Y (fix (+ (distance p1 p2) C100X))
   Dg1(angtos (angle p0 p1))        Dg2(angtos (angle p1 p2))         )
);eHcorner

(defun SJcorner () (setq WLY "CCSsc" C100X 100.5 BLK (strcat LIBblk "_SC")) 
(Hcorner) (setq m p1 R Dg2 )(setvar "osmode" 0) (IN-SC) );eSJcorner

(defun C:SC () (setq CC FC_SC)  (SJcorner))    
   (defun C:SCA() (setq CC (strcat FC_SC "A")) (SJcorner))
   (defun C:SCB() (setq CC (strcat FC_SC "B")) (SJcorner))
   (defun C:SCD() (setq CC (strcat FC_SC "D")) (SJcorner))
   (defun C:SCE() (setq CC (strcat FC_SC "E")) (SJcorner))
   (defun C:SCx() (setq CC (strcat FC_SC "X")) (SJcorner))
   (defun C:SCy() (setq CC (strcat FC_SC "Y")) (SJcorner))
   (defun C:SCz() (setq CC (strcat FC_SC "Z")) (SJcorner))
(defun C:UC () (setq CC FC_UC)  (SJcorner))    (defun C:UCA() (setq CC "UCA") (SJcorner))
                       (defun C:UCB() (setq CC "UCB") (SJcorner))
                       (defun C:UCD() (setq CC "UCD") (SJcorner))
                       (defun C:UCE() (setq CC "UCE") (SJcorner))
                       (defun C:UCx() (setq CC "UCX") (SJcorner))
                       (defun C:UCy() (setq CC "UCY") (SJcorner))
                       (defun C:UCz() (setq CC "UCZ") (SJcorner))
(defun C:BCA() (setq CC "BCA") (SJcorner))    (defun C:BCB() (setq CC "BCB") (SJcorner))
(defun C:BCC() (setq CC "BCC") (SJcorner))    (defun C:BCD() (setq CC "BCD") (SJcorner))
(defun C:BCE() (setq CC "BCE") (SJcorner))
(defun C:BCx() (setq CC "BCX") (SJcorner))    ; 9409a-Beam Side Corner W+L*H
(defun C:BCy() (setq CC "BCY") (SJcorner))    ;    A=75, B=100, C=125, D=150, E=175
(defun C:BCz() (setq CC "BCZ") (SJcorner))    ;    X=13, Y= 25, Z= 50, W=85
(defun C:BCw() (setq CC "BCW") (SJcorner))    

;8713 programme for auto input "SL",SLAB REVERSED CORNER                                      
;==================================================================================================
(defun SLcorner () (setq WLY "CCSsl" C100X -99.5 BLK (strcat LIBblk "_SL")) 
(Hcorner) (setq m p1 R Dg1 )(setvar "osmode" 0) (IN-SC) );eSLcorner

(defun C:SL () (setq CC "SL")  (SLcorner))    (defun C:SLA() (setq CC "SLA") (SLcorner))
                       (defun C:SLB() (setq CC "SLB") (SLcorner))
                       (defun C:SLD() (setq CC "SLD") (SLcorner))
                       (defun C:SLE() (setq CC "SLE") (SLcorner))
                       (defun C:SLx() (setq CC "SLX") (SLcorner))
                       (defun C:SLy() (setq CC "SLY") (SLcorner))
                       (defun C:SLz() (setq CC "SLZ") (SLcorner))
(defun C:UL () (setq CC "UL")  (SLcorner))    (defun C:ULA() (setq CC "ULA") (SLcorner))
                       (defun C:ULB() (setq CC "ULB") (SLcorner))
                       (defun C:ULD() (setq CC "ULD") (SLcorner))
                       (defun C:ULE() (setq CC "ULE") (SLcorner))
                       (defun C:ULx() (setq CC "ULX") (SLcorner))
                       (defun C:ULy() (setq CC "ULY") (SLcorner))
                       (defun C:ULz() (setq CC "ULZ") (SLcorner))
(defun C:BLA() (setq CC "BLA") (SLcorner))    (defun C:BLB() (setq CC "BLB") (SLcorner))
(defun C:BLC() (setq CC "BLC") (SLcorner))    (defun C:BLD() (setq CC "BLD") (SLcorner))
(defun C:BLE() (setq CC "BLE") (SLcorner))
(defun C:BLx() (setq CC "BLX") (SLcorner))    (defun C:BLy() (setq CC "BLY") (SLcorner))
(defun C:BLz() (setq CC "BLZ") (SLcorner))
;==============================================================================================

(defun C:KP () (load (strcat LIBlsp "kickplan")) )
(defun C:CA ()  (command "osnap" "none" "ATTDISP" "ON")
       (command "ATTEDIT" "NO" "" "" "A" "A" "C" pause pause "A"))
;(defun C:B? () (command "vslide" (strcat LIB "BINHELP")))
(defun C:B? () (command "vslide" (strcat LIB "bin-open")))

;Input DooR opening Formwork panel as elev. 190994
;=================================================
(defun C:DRF ()  (MINFO) (command "_layer" "M" "COM" "" "")
(setvar "mirrtext" 0)(command "undo" "BE")
(if (< Wall 1) 
  (setq Wthk (getint "\n Enter wall thickness in mm : "))
  (setq Wthk (strcat (getint "\n Enter wall thickness in mm") "< " Wall " >: ")))
   (setq   M (mapcar '+ '(0 150) m)
       Mir1 (mapcar '/ (mapcar  '+ P2 P3) '(2 2) )
       Mir2 (mapcar '/ (mapcar  '+ P1 P4) '(2 2) )
       H (- dy 175) H1 H
       CNl (+ Wthk 132)
       Ip0 (mapcar '/ (mapcar  '+ P1 P2) '(2 2) )
       IP1 (mapcar '+ '(125 0) Ip0)    
       Ip2 (mapcar '+ '( 80 0) Ip1)
        Ip3 (mapcar '+ '( 80 0) Ip2)
       Ip4 (mapcar '+ '(125 -380) p1)
       Ip5 (mapcar '+ '(125 250) p2)
       rad1 (angle p1 p2) rad2 (angle p1 p4)
       p1a  (polar p1 rad1 125)
       p1b  (mapcar '+ p1 '(66 -125))
       p1bW (mapcar '+ p1 '(600 0))
       p1c (polar p1 rad2 100)
       p1d (polar p1c rad1 66)
       p4a (mapcar '+ p4 '(-100 -66))
       p4b (mapcar '+ p4 '(-100 0))
       p2a (mapcar '+ p2 '(0  50))
       p2b (mapcar '+ p2 '(66 50))    n 0 R 90    )
(if (> 200 Wthk) (setq n 1 p2a p2 H1 (+ H 50))    )

   (while (< n 5 )  
      (cond ((= n 1)(setq M Ip2 x Wthk CC "WE" y H1))
       ((= n 2)(setq M Ip1 x  " " CC "AE" y H))
       ((= n 3)(setq M Ip3 x  " " CC "AE" y H))
       ((= n 4)(setq M Ip4 x  " " CC "NC" y CNl))
       ((= n 0)(setq M Ip5 x   50 CC "WH" y Wthk))    )
     (setq n(1+ n))
     (command "_insert" WCL M """" R x CC y)
   )

(command "_pline" p1a p1b p2b p2a "" "_pline" p1c p1d p4a p4b ""
    "_mirror" "w" P2 p1bW "" Mir1 Mir2 "n" ""     
    "_layer" "M" "CCW" "" "")
(command "undo" "E")
);eDRF

;Input WinDoR opening Formwork panel as elev. 290994
;===================================================
(defun C:WDF ()  (MINFO) 
(setvar "mirrtext" 0)(command "undo" "BE")(command "_layer" "M" "COM" "" "")
(if (< Wall 1) 
  (setq Wthk (getint "\n Enter wall thickness in mm : "))
  (setq Wthk (strcat (getint "\n Enter wall thickness in mm") "< " Wall " >: ")))
   (setq   M (mapcar '+ '(0 150) m)
       Mir1 (mapcar '/ (mapcar  '+ P2 P3) '(2 2) )
       Mir2 (mapcar '/ (mapcar  '+ P1 P4) '(2 2) )
       H (- dy 175) H1 H
       CNl (+ Wthk 0)
       Ip0 (mapcar '/ (mapcar  '+ P1 P2) '(2 2) )
       IP1 (mapcar '+ '(125 -100) Ip0)    Ip2 (mapcar '+ '( 80    0) Ip1)
       Ip3 (mapcar '+ '( 80    0) Ip2)    Ip4 (mapcar '+ '(125 -380) p1)
       Ip5 (mapcar '+ '(125 250) p2)
       rad1 (angle p1 p2) rad2 (angle p1 p4)
       p1a  (polar p1 rad1 125)    p1b  (mapcar '+ p1 '(66 -125))
       p1bW (mapcar '+ p1 '(600 0))
       p1c (polar p1 rad2 100)     p1d (polar p1c rad1 66)
       p4a (mapcar '+ p4 '(-100 -66))    p4b (mapcar '+ p4 '(-100 0))
       p2a (mapcar '+ p2 '(0  50))     p2b (mapcar '+ p2 '(66     50))
       Ivb (mapcar '+ '(0 75) Mir1)
       n 0 R 90    )
   
(if (> 200 Wthk) (setq  n 1 p2a p2 H1 (+ H 50)) 
;            vb1 (mapcar '+ p2 '(80  0))    vb2 (mapcar '+ p2 '(80 20))
;            vb3 (mapcar '+ p3 '(-80 20))    vb4 (mapcar '+ p3 '(-80 0)))
);EIf

;; bothsides cut 70mm
(setq CUT 140 vb1 (mapcar '+ p2 '(70  0))    vb2 (mapcar '+ p2 '(70 20))
         vb3 (mapcar '+ p3 '(-70 20))    vb4 (mapcar '+ p3 '(-70 0)))

   (while (< n 6 )  
      (cond ((= n 1)(setq M Ip2 x Wthk         CC "WX" y H1))
       ((= n 2)(setq M Ip1 x  " "         CC "AX" y H) )
       ((= n 3)(setq M Ip3 x  " "         CC "AX" y H) )
       ((= n 4)(setq M Ip4 x  " "         CC "NC" y (+ Wthk 132) ))
       ((= n 5)(setq M Ivb x (+ Wthk 132) CC "WB" y (- dx CUT) R 0))
       ((= n 0)(setq M Ip5 x   50 CC "WH" y CNl))    )
     (setq n(1+ n))
     (command "_insert" WCL M """" R x CC y)    );eWhile

(command "_pline" p1a p1b p2b p2a "" "_pline" p1c p1d p4a p4b ""
    "_pline" vb1 vb2 vb3 vb4 ""     
    "_mirror" "w" P2 p1bW "" Mir1 Mir2 "n" ""     
    "_layer" "M" "CCW" "" "")

(command "undo" "E")
);eWDF

;;;channel prop head auto, 2/6/95
;;;==============================
(DEFUN PROPHD ()(command "layer" "M" WLY "") (INFO) (FILL)
 (if (= x 100) (setq WC CC) (setq WC (strcat (itoa X) CC )) )        
   (setq STR (strcat WC (itoa Y) ) R 0 M Md1 )(INS-DSTD)
   (setq STR (strcat PLCode "nnnn") R 0 M "@0,-100")(INS-DSTD)
 
 (if (> Dx Dy) (setq R 90 x Dy y Dx INS P2)    ; BLOCK
       (setq R  0 x Dx y Dy INS P1))      ; INFORMATION
 (command "_insert" (strcat LIBsym "S_PLC") INS X Y R)        );ePROHD
   
(defun C:CHH () (setq WLY "CCBch" CC FC_CH PLCode "PLJ")
 (prompt "\n***___CHANNEL PROP HEAD PROGRAM ver1.0____020695 CT***")
 (prompt "\n***___Start picking from TOP LEFT to BOTTOM RIGHT_____***")
 (PROPHD) )

(defun C:BHH () () (setq WLY "CCBbh" CC FC_BH PLCode "PL")
(prompt "\n***___BEAM PROP HEAD PROGRAM  ***")
 (prompt "\n***___Start picking from TOP LEFT to BOTTOM RIGHT_____***")
 (PROPHD) )

;;;Tie input to wall layout, 2/6/95
;;;================================
(defun c:TIE ()
(command "layer" "M" "tie" "")
(setvar "osmode" 33)
 (setq p1 (getpoint    "\nStarting point : ")
     p2 (getpoint p1 "\nEnding poing : "  )
     d1 (fix (+ (distance p1 p2) 0.5))
     rang (angle p1 p2)
     ang (/ (* rang 180.0) pi)
   TIElng (strcat "TE" (itoa (+ d1 205)))
 )
(command "insert" (strcat LIBblk "S_tie") p1 d1 "" ang TIElng)
)

;980102 [sLAB]menu -> key commands
(defun getpt () (setvar "osmode" 32)
       (setq pt1 (getpoint "\nGet Intersect for insertion: "))
       (setvar "osmode"  0) )

(defun C:L1 () (getpt) (command ".insert" (strcat LIBblk "F_lh") pt1 """" pause "" 1))    ;slab100
(defun C:L11() (getpt) (command ".insert" (strcat LIBblk "F_lh") pt1 """" pause "" 115));slab115
(defun C:L2 () (getpt) (command ".insert" (strcat LIBblk "F_lh") pt1 """" pause "" 2))    ;slab125
(defun C:L3 () (getpt) (command ".insert" (strcat LIBblk "F_lh") pt1 """" pause "" 3))    ;slab150
(defun C:L4 () (getpt) (command ".insert" (strcat LIBblk "F_lh") pt1 """" pause "" 4))    ;slab175
(defun C:L5 () (getpt) (command ".insert" (strcat LIBblk "F_lh") pt1 """" pause "" 5))    ;slab200
(defun C:L6 () (getpt) (command ".insert" (strcat LIBblk "F_lh") pt1 """" pause "" 6))    ;slab225
(defun C:L7 () (getpt) (command ".insert" (strcat LIBblk "F_lh") pt1 """" pause "" 7))    ;slab250
(defun C:L8 () (getpt) (command ".insert" (strcat LIBblk "F_lh") pt1 """" pause "" )    ;slab275
(defun C:L9 () (getpt) (command ".insert" (strcat LIBblk "F_lh") pt1 """" pause "" 9))    ;slab300
(defun C:L0 () (getpt) (command ".insert" (strcat LIBblk "F_lh-HK") pt1 """" pause "" "H"))     ;HK-LH200 no PL   
(defun C:L30 () (getpt) (command ".insert" (strcat LIBblk "F_lh-HK300") pt1 """" pause "" "H")) ;HK-LH300 no PL   
(defun C:LA () (getpt) (command ".insert" (strcat LIBblk "F_lh225") pt1 """" pause "" "JA"))     ;HK-LH200 no PL   

(defun C:sJ6  () (getpt) (command ".insert" (strcat "*" LIBmod "sJ6")  pt1 "" ))    ;CJ600
(defun C:sJ9  () (getpt) (command ".insert" (strcat "*" LIBmod "sJ9") pt1 "" ))
(defun C:sJ12 () (getpt) (command ".insert" (strcat "*" LIBmod "sJ12") pt1 "" ))    
(defun C:sJ15 () (getpt) (command ".insert" (strcat "*" LIBmod "sJ15") pt1 "" ))    
(defun C:sJ18 () (getpt) (command ".insert" (strcat "*" LIBmod "sJ18") pt1 "" ))    

(defun C:LS7  () (getpt) (command ".insert" (strcat "*" LIBmod "LS7")  pt1 "" ))    ;LS700
(defun C:LS1  () (getpt) (command ".insert" (strcat "*" LIBmod "LS1")  pt1 "" ))    
(defun C:LS13 () (getpt) (command ".insert" (strcat "*" LIBmod "LS13") pt1 "" ))

(defun C:LM7  () (getpt) (command ".insert" (strcat "*" LIBmod "LM7")  pt1 "" ))    ;LM700
(defun C:LM1  () (getpt) (command ".insert" (strcat "*" LIBmod "LM1")  pt1 "" ))    
(defun C:LM13 () (getpt) (command ".insert" (strcat "*" LIBmod "LM13") pt1 "" ))



(defun C:DDET () (getpt) (command ".insert" (strcat LIBdet "det_TMPLT") pt1 """" pause ""))  
(defun C:DDET3 () (getpt) (command ".insert" (strcat LIBdet "det_TMPLT3D") pt1 """" pause ""))


;9B01 Games Centre
;(load (strcat LIBgame "\MastrMnd"))


;Revision records#
;9409a-Beam Side Corner add BCW(85)

20030520 Short-cut to global change area code "Z"
;Command: -ATTEDIT
;    Edit attributes one at a time? [Yes/No] <Y>: N
;    Performing global editing of attribute values.
;    Edit only attributes visible on screen? [Yes/No] <Y>:
;    Enter block name specification <*>:
;    Enter attribute tag specification <*>:
;    Enter attribute value specification <*>: Z
;    Select Attributes:
;        0 attributes selected.*Invalid*

(defun C:CAT ()

Link to comment
Share on other sites

;------------------------------------------------------------------------------
;#SLAB(DECK)
;===========
(defun GET-TXT  () (if (> Dx Dy) (setq R 0 x Dy y Dx) (setq R 90 x Dx y Dy))
          (setq STR (strcat (itoa X) " " CC " " (itoa Y))))

(defun INS-DSTD () (command "layer" "M" WLY "")
          (command "insert" (strcat LIBblk "D-STD") M """" R STR) )

;set working layer(WLY)
(defun IN-SLAB () (command "layer" "M" WLY "")    
         (command "insert" (strcat LIBblk "SLAB-STD") M """" R STR) )

(DEFUN SLAB () (COND  ((< y 451) (progn (setq BLK W__)    (IN-WCL)))
       ((AND (= x 450)(= y 1400)) (setq STR "S1")(IN-SLAB))
       ((AND (= x 450)(= y 1100)) (setq STR "S2")(IN-SLAB))
       ((AND (= x 450) (= y 950)) (setq STR "S3")(IN-SLAB))
       ((AND (= x 450) (= y 800)) (setq STR "S4")(IN-SLAB))
       ((> x 1)(progn (command "layer" "M" WLY "")(IN-ONE))    )    ));eSLAB
             
(DEFUN C:DE () (INFO)(FILL)(setq WLY "CCD") (if (< x 176)(setq CC "D")
                            (setq CC "D")) (GET-TXT)(SLAB))
(DEFUN C:DR () (INFO)(FILL)(setq WLY "CCD") (if (< x 176)(setq CC "DR")
                            (setq CC "DR")) (GET-TXT)(SLAB))


(DEFUN C:SP () (INFO)(FILL)(setq WLY "CCD") (if (< x 176)(setq CC "D")
                            (setq CC "SP")) (GET-TXT)(IN-ONE))

(defun INPT1 () (setq Iph (mapcar '- M '(90 0))
             Ipv (mapcar '- M '(0 90)))
(if (< dy dx) (setq M Iph x dy y dx R 0) (setq M Ipv x dx y dy R 90))
(if (or (= dx 100) (= dy 100)) (setq x ""))
(IN-WCL))

(DEFUN SJMENU ()(command "layer" "M" WLY "")
       (menucmd "S=X")(menucmd "S=SLABJT")
       (INFO)   (if (> Dx Dy) (setq R 0 x Dy y Dx)
                      (setq R 90 x Dx y Dy))
       (if (or(= x 125)(= x 100)(< x 67))
           (progn (setq STR (strcat CC " " (itoa Y))) (INS-DSTD))
           (IN-ONE))    )

(defun C:SL () (setq WLY "CCDsl" CC "SL")   (SJMENU) )
(defun C:IC () (setq WLY "CCDic" CC "IC")   (SJMENU) )
(defun C:EC () (setq WLY "CCDec" CC "EC")   (SJMENU) )
(defun C:SLR () (setq WLY "CCslr" CC "SLR")   (SJMENU) )
(defun C:URJ() (setq WLY "CCDurj" CC "URJ")  (SJMENU) )
(defun C:TFH() (INFO)(FILL) (setq WLY "CCDtfh" CC "TFH" STR (strcat CC " " (itoa Y))) (INS-DSTD) )

(defun C:KJ () (setq WLY "CCDkj" CC "KJX") (SJMENU) )

(defun C:SLB() (setq WLY "CCDsj" CC "SLB") (SJMENU) )
(defun C:UJB() (setq WLY "CCDuj" CC "UJB") (SJMENU) )

(defun C:BJ () (command "vslide" (strcat LIBsld "B-SUPDED") ))
(defun C:BJB() (command "vslide" (strcat LIBsld "B-SUPDED") ))
(defun C:EB () (setq WLY "CCDeb" CC "EB")  (SJMENU) )
(defun C:MB () (setq WLY "CCDmb" CC "MB")  (SJMENU) )
(defun C:LX () (setq WLY "CCDlx" CC "LX")  (SJMENU) )

(defun IN-STD () (setq STR (strcat X " " CC " " (itoa Y)))
          (command "insert" _STD M """" R STR))

(defun C:SJ7() (INFO)(FILL) (setq WLY "CCDSJ7" X  "75" CC "SJ") (IN-STD))
(defun C:SJ1() (INFO)(FILL) (setq WLY "CCDSJ1" X "100" CC "SJ") (IN-STD))  
 
(defun C:DPP () (setq CC "DP" WLY "CCsdp") (INFO) (FILL)
(setq Y (+ 0 y))                        ;230395 DROPPER  
 (IN-ONE))                               ;141196 removed +20  


(defun getpt () (setvar "osmode" 32)
       (setq pt1 (getpoint "\nGet Intersect for insertion: "))
       (setvar "osmode"  0) )

(defun C:DP () (getpt) (command ".insert" (strcat LIBblk "S_S-DP300") pt1 """" pause "" 1))    ;DECK PROP

Link to comment
Share on other sites

This is huge and not a 5 minute fix really dont even know where to start you have so many commands what you need to do is find the 1st one that you use the C:something and follow the trail by cutting and pasting the defuns into a new file this should make a new complete lisp that can then be tested. The other way is to add a (princ "\nname of defun") to each defun this way you can see last defun that it used and stopped on, Not the C: ones

 

(defun slab .....

)[color=red](princ "\nSlab")[/color]);eSLAB

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...