李,
我确实有点卡住了。我正在尝试将其集成到我的代码中。当我运行这个时,我得到了一个错误:“错误的参数类型:fixnump:nil”。我在开始时将d设置为1500作为默认值,所以我不确定为什么会得到这个值。我认为COND设置正确,因为我根据大小在那里设置了d的值。
-
- (defun C:ESS02 () ;define function
- (setq dcl_id (load_dialog "ESS.dcl")) ;load dialog
- (setq d 1500)
- ;(setq b "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1500")
- (if
- (not (new_dialog "ESS" dcl_id) ;test for dialog
- );not
- (progn
- (alert "Can not find your dcl file")
- (exit) ;exit if no dialog
- )
- );if
- (set_tile "1500" "1") ;Set radio_button T1 as default
- (setq hole "S1") ;Set variable hole to S1 as default
- (action_tile "1500" "(setq hole "S1")") ;*store hole type
- (action_tile "1350" "(setq hole "S2")") ;*store hole type
- (action_tile "1200" "(setq hole "S3")") ;*store hole type
- (action_tile "1050" "(setq hole "S4")") ;*store hole type
- (action_tile "900" "(setq hole "S5")") ;*store hole type
- (action_tile "750" "(setq hole "S6")") ;*store hole type
- (action_tile "675" "(setq hole "S7")") ;*store hole type
- (action_tile "600" "(setq hole "S8")") ;*store hole type
- (action_tile "525" "(setq hole "S9")") ;*store hole type
- (action_tile "450" "(setq hole "S10")") ;*store hole type
- (action_tile "375" "(setq hole "S11")") ;*store hole type
- (action_tile "300" "(setq hole "S12")") ;*store hole type
- (action_tile "225" "(setq hole "S13")") ;*store hole type
- (action_tile "150" "(setq hole "S14")") ;*store hole type
- (action_tile "cancel" ;if cancel button pressed
- "(done_dialog)(setq userclick nil)" ;close dialog, set flag
- );action_tile
- (action_tile "accept" ;if O.K. pressed
- "(done_dialog)(setq userclick T))"
- );action tile
- (start_dialog) ;start dialog
- (unload_dialog dcl_id) ;unload
- (if userclick ;When OK button is selected
- (cond ;And one of the following conditions apply
- ((= hole "S1")(setq d 1500)) ;If S1 selected, d = 1500
- ((= hole "S2")(setq d 1350)) ;If S2 selected, d = 1350
- ((= hole "S3")(setq d 1200)) ;If S3 selected, d = 1200
- ((= hole "S4")(setq d 1050)) ;If S4 selected, d = 1050
- ((= hole "S5")(setq d 900)) ;If S4 selected, d = 900
- ((= hole "S6")(setq d 750)) ;If S4 selected, d = 750
- ((= hole "S7")(setq d 675)) ;If S4 selected, d = 675
- ((= hole "S8")(setq d 600)) ;If S4 selected, d = 600
- ((= hole "S9")(setq d 525)) ;If S4 selected, d = 525
- ((= hole "S10")(setq d 450)) ;If S4 selected, d = 450
- ((= hole "S11")(setq d 375)) ;If S4 selected, d = 375
- ((= hole "S12")(setq d 300)) ;If S4 selected, d = 300
- ((= hole "S13")(setq d 225)) ;If S4 selected, d = 225
- ((= hole "S14")(setq d 150)) ;If S4 selected, d = 150
- ;(t (princ "\nNothing changed.")) ;_ end of optional else condition
- ) ;End cond
- ) ;End if
- (princ) ;Exit quietly
- ) ;End defun
- (princ "\nThis loaded fine")
- (setq a (strcat "CCC_DR_" (itoa d)))
- (setq b )strcat "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_" (itoa d)))
- (if (= (tblsearch "ltype" a) nil)
- (command "-linetype" "l" a "acadiso.lin" "")
- (princ))
- (graphscr)
- (command "._-layer" "N" b "M" b "L" a b "C" "84" b "LW" "0.3" b "" )
- (command "pline" pause "width" "0.0" "0.0" pause "width" "0.0" "0.0")
- (princ)
- )
|