How do I get this hatch pattern list to work in this dcl. Do I need to convert the pattern name to a number? I am pretty lost on what to do next on this.
(defun c:ww () (defun dfaults () (if (= dia nil) (setq dia 1.0)) ;;; Dialog Menu Presets (setq names '("Ansi31" "Ansi32" "Ansi33")) (if dia (set_tile "dia" (rtos dia 2 1))) ;;; Dialog Menu Callback (if selections (set_tile "selections" selections))
(start_list "selections") (mapcar 'add_list names) (end_list) ) ;end of dfaults (initiate) (setq p1 (getpoint "\nSpecify starting point: ")) (command "circle" p1 dia) (command "-HATCH" "p" names "1" "" p1 "") (princ) ) (defun initiate () (setq dcl_id (load_dialog "ww.dcl")) (if (not (new_dialog "ww" dcl_id)) (exit) ) (DFAULTS) (action_tile "dia" "(setq dia (distof $value))") (action_tile "selections" "(setq selections $value)") (action_tile "accept" "(done_dialog)") (action_tile "cancel" "(exit)") (start_dialog) (unload_dialog dcl_id) (princ) )
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
Quick hack
(defun c:ww () (defun dfaults () (if (= dia nil) (setq dia 1.0)) ;;; Dialog Menu Presets (setq names '("Ansi31" "Ansi32" "Ansi33")) (if dia (set_tile "dia" (rtos dia 2 1))) ;;; Dialog Menu Callback (set_tile "selections" (if selections selections (setq selections "0"))) (start_list "selections") (mapcar 'add_list names) (end_list) ) ;end of dfaults (initiate) (setq p1 (getpoint "\nSpecify starting point: ")) (command "circle" p1 dia) (command "-HATCH" "p" (nth (atoi selections) names) "1" "" p1 "") (princ) ) (defun initiate () (setq dcl_id (load_dialog "ww.dcl")) (if (not (new_dialog "ww" dcl_id)) (exit) ) (DFAULTS) (action_tile "dia" "(setq dia (distof $value))") (action_tile "selections" "(setq selections $value)") (action_tile "accept" "(done_dialog)") (action_tile "cancel" "(exit)") (start_dialog) (unload_dialog dcl_id) (princ) )
HTH
Genius pbejse! I was playing around with the following but was not getting the correct results. You saved the day. Thanks!
(setq patt (atof (get_tile "selections")))
(setq patt (fix patt))
(setq patt (nth patt names))
Can't find what you're looking for? Ask the community or share your knowledge.