对不起,这就是我为什么不是老师的原因,卡恩解释道。
因此,当您将其传递给dcl时,您已经有了一个块名称(BlkNam)。
-
- (StartDcl) ; will start the dcl the ussual crap, (which sound liike you know)
- (set_tile "Someeditbox" BlkNam)
- (action_tile "SelectNewBlock" "(setq flager 2) (done_dialouge) ")
- (action_tile "accept" "(setq flager 1)(getstuff such as needed ) (done_dialouge)")
- (action_tile "cancel" (setq flager 0) (done_dialouge))
- (enddcl) ;you know that with the unload_dilogue
- (while (not (>= flager 1)
- (cond
- ((= flager 3)
- (setq BlkName (car (entsel))
- )
- );end cond
- ;With the new block name go back to
- (startdcl)
- );endwhile
真实生活示例
- (defun beamdio ()
- (setq dialo (load_dialog "MainDCL"))
- (if (not (new_dialog "Pfcbox" dialo)) (exit))
- (start_list "beamtype")
- (mapcar 'add_list pfcsizes)
- (end_list)
- (if (not sectiontype)
- (set_tile "beamtype" sectiontype)
- )
- (if (not sectionlength)
- (set_tile "length" sectionlength)
- )
- (if (not bendradius)
- (set_tile "rolled" bendradius)
- )
- (if (not roangle )
- (set_tile "angle" roangle)
- )
- (if toetoggle (set_tile "toetrim" (itoa toetoggle)))
- ;what to do settings
- (action_tile "toetrim" "(if (= toetoggle 1)(setq toetoggle 0)(setq toetoggle 1))")
- (action_tile "cancel" "(setq ok 0)(done_dialog)(exit)")
- (action_tile "accept" "(setq ok 1)
- (setq sectiontype (strcase(get_tile "beamtype")))
- (setq sectionlength (strcase(get_tile "length")))
- (setq bendradius (strcase(get_tile "rolled")))
- (setq roangle (strcase(get_tile "angle")))
- (done_dialog)"
- )
- (action_tile "lengthget" "(setq ok 4)
- (setq sectiontype (strcase(get_tile "beamtype")))
- (setq sectionlength (strcase(get_tile "length")))
- (setq bendradius (strcase(get_tile "rolled")))
- (setq roangle (strcase(get_tile "angle")))
- (done_dialog)"
- )
- (action_tile "rolledidget" "(setq ok 5)
- (setq sectiontype (strcase(get_tile "beamtype")))
- (setq sectionlength (strcase(get_tile "length")))
- (setq bendradius (strcase(get_tile "rolled")))
- (setq roangle (strcase(get_tile "angle")))
- (done_dialog)"
- )
- (action_tile "angleget" "(setq ok 6)
- (setq sectiontype (strcase(get_tile "beamtype")))
- (setq sectionlength (strcase(get_tile "length")))
- (setq bendradius (strcase(get_tile "rolled")))
- (setq roangle (strcase(get_tile "angle")))
- (done_dialog)"
- )
- (start_dialog)
- (unload_dialog dialo)
- )
- (beamdio)
- (while (not (or (= ok 0)(= ok 1)))
- (cond
- ((= ok 4)
- (setq sectionlength (rtos (getdist "\nWhat is the Length")2 0)
- bendradius ""
- bendangle "")
- )
- ((= ok 5)
- (setq bendradius (rtos (getdist "\nWhat is the radius of in inside:")2 0)
- sectionlength (rtos (* pi (atof bendradius) 2)2 0)
- bendangle "")
- )
- ((= ok 6)
- (setq bendangle (anglefinder)
- sectionlength (rtos (* (atof sectionlength) (/ (atof bendangle) 360.00))2 0))
- (if (not (= bendangle 360))
- (setq rord "I/R"))
- )
- )
- (beamdio)
- )
感觉更好? |