Message 1 of 7
Homerun Lisp routine that has stopped
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an homerun.lsp routine that has worked in the past and after moving to a new company I now can't get it to work for some reason. When I run it it just prints the princ line followed with "error: quit / exit abort"
I'm not sure what is causing the error out of the routine. Could someone with knowledge look at this or try it and see what could be the issue? I have the code for the lsp routine as well as the dcl file for the dialog box and both are zipped as an attachment.
Homerun.lsp
(defun c:hr (); (princ "\nHOMERUN.lsp) (if (= place_cir nil) (setq place_cir "0")) (if (= place_pnl nil) (setq place_pnl "0")) (if (= no_circuits nil) (setq no_circuits "1")) (if (= to_panel nil) (setq to_panel "")) (setq dcl_id (load_dialog "homerun.dcl")) (if (not (new_dialog "homerun" dcl_id)) (exit) ) (set_tile "place_cir" place_cir) (set_tile "place_pnl" place_pnl) (if (= place_pnl "0") (mode_tile "to_panel" 1)) (set_tile "to_panel" to_panel) (set_tile "no_circuits" no_circuits) (mode_tile "no_circuits" 2) (action_tile "place_pnl" "(setq place_pnl $value)(mode_tile \"to_panel\" (- 1 (atoi $value)))") (action_tile "place_cir" "(setq place_cir $value)") (action_tile "to_panel" "(setq to_panel $value)") (action_tile "no_circuits" "(setq no_circuits $value)") (start_dialog) (unload_dialog dcl_id) (setq cstyle (getvar "textstyle")) (setq reset (getvar"clayer")) (setq sf (getvar "dimscale")) (setq arrsize (* 0.16 sf)) (setq arrwidth (* arrsize 0.333)) (command "redraw") (setq sp (getpoint "\nSelect start point: ")) (setq dp (getpoint sp "\nSelect start angle: ")) (setq sar (angle sp dp)) (setq sad (* sar (/ 180 pi))) (setq tsp (polar sp (+ sar pi) (* 0.2 sf))) (if (= place_pnl "1") (progn (command "layer" "s" "note" "") (command "text" "s" "4" "M" tsp "" 0 (prin1 to_panel)) )) (command "layer" "s" "E-Homerun" "") (setq count 0) (while (< count (atoi no_circuits)) (setq ep (polar sp sar arrsize)) (command "pline" sp "w" 0 arrwidth ep "") (if (= place_cir "1") (progn (setq c (1+ count)) (command "layer" "s" "note" "") (prompt "\nCircuit No. ") (prompt (rtos c 5)) (setq ctext (getstring ": ")) (setq cnsp (polar sp sar (/ (distance sp ep) 2.0))) (setq cnsp (polar cnsp (+ sar (/ pi 2.0)) (* 0.15 sf))) (command "text" "s" "4" "m" cnsp "" 0 (prin1 ctext)) (command "layer" "s" "E-Homerun" "") )) (setq sp ep) (setq count (1+ count)) ) (setvar "textstyle" cstyle) (command "pline" sp "w" 0 0 "a") )
homerun.dcl
homerun : dialog { label = "Draw Home Run"; : image { label = "Zork!"; key = "tester"; } : boxed_column { label = "Panel Text:"; : toggle { label = "Place"; key = "place_pnl"; mnemonic = "C"; } : edit_box { label = "Designation:"; key = "to_panel"; mnemonic = "L"; } } : boxed_column { label = "Circuit Numbers:"; : toggle { label = "Place"; key = "place_cir"; mnemonic = "P"; } : edit_box { label = "No. of circuits:"; mnemonic = "N"; key = "no_circuits"; allow_accept = true; } } ok_cancel; }
Thanks a ton!