Hmmm, I'm running into a whole new issue....
How does one structure a series of user condition input queires?
I never tried to drill down through them to make the lists shorter?
I went a roundabout way but it seems to loop back to the original ductfittings line everytime I make a selection:
;======================================================================================================= ductfittings
(defun ductfittings ()
(command "osmode" 767)
(command "polarang" 15)
(command "autosnap" 29)
(command "snapang" 0)
(command "cmdecho" 0)
(command "-units" "4" "16" "1" "2" "0" "N")
(command "cmdecho" 1)
(initget "Duct,D Elbow,E Transition,T tAkeoff,A fleX,X" )
(setq fitting (getkword "Duct \ Elbows \ Transitions \ takeOffs \ Flexduct : \n< D/E/T/O/F > D = continue Duct:"))
(cond
((= fitting "Duct") (continueduct))
((= fitting "Elbows") (elbows))
((= fitting "Transitions") (transitions))
((= fitting "takeOffs") (takeoffs))
((= fitting "Flexduct") (c:flex))
)
;(command "polarang" userpol)
;(command "clayer" userlayer); -----------------------Return User Layer Settings
(*error* "") ; restore variables
(princ "\n Osnaps returned. ductfittings..") ; -----------------------Return User Osmode Settings
)
;======================================================================================================= End of ductfittings
;======================================================================================================= elbows
(defun elbows ()
(command "osmode" 767)
(command "polarang" 15)
(command "autosnap" 29)
(command "snapang" 0)
(command "cmdecho" 0)
(command "-units" "4" "16" "1" "2" "0" "N")
(command "cmdecho" 1)
(initget "Radius,R radiusAngle,A eLle,L Elleangle,E " )
(setq fitting (getkword "Radius / radiusAngle / eLle / Elleangle : \n< R/A/L/E > L = Elle :"))
(cond
((= fitting "Radius") (radius))
((= fitting "radiusAngle") (radiusAngle))
((= fitting "eLle") (elle))
((= fitting "Elleangle") (elleAngle))
) ; End cond
(*error* "") ; restore variables
(princ "\n Osnaps returned. Elbows..") ; -----------------------Return User Osmode Settings
); End of Elbows
;======================================================================================================= End of Elbows
;======================================================================================================= transitions
(defun transitions ()
(command "osmode" 767)
(command "polarang" 15)
(command "autosnap" 29)
(command "snapang" 0)
(command "cmdecho" 0)
(command "-units" "4" "16" "1" "2" "0" "N")
(command "cmdecho" 1)
(initget " Htransition,H Ctransition,C Otransition,O " )
(setq fitting (getkword "Htransition / Ctransition / Otransition : \n< H/C/O > C = concentric transition :"))
(cond
((= fitting "Htransition") (htransition))
((= fitting "Ctransition") (ctransition))
((= fitting "Otransition") (otransition))
)
(*error* "") ; restore variables
(princ "\n Osnaps returned. transitions..") ; -----------------------Return User Osmode Settings
)
;======================================================================================================= End of transitions
;======================================================================================================= takeoffs
(defun takeoffs ()
(command "osmode" 767)
(command "polarang" 15)
(command "autosnap" 29)
(command "snapang" 0)
(command "cmdecho" 0)
(command "-units" "4" "16" "1" "2" "0" "N")
(command "cmdecho" 1)
(initget "Rtakeoff,R Otakeoff,O " )
(setq fitting (getkword "Rtakeoff / Otakeoff : \n< R/O > O = rectangular takeoff:"))
(cond
((= fitting "Rtakeoff") (rtakeoff))
((= fitting "OtaKeoff") (otaKeoff))
)
(*error* "") ; restore variables
(princ "\n Osnaps returned. takeoffs..") ; -----------------------Return User Osmode Settings
)
;======================================================================================================= End of takeoffs