cadmando2 Posted February 26, 2009 Posted February 26, 2009 I need a lisp routine to do ceiling grids that works. The Cgrid.lsp works great, But when you specfie a centen locate it does not start where I specify. Can anyone look at this lisp file and fix it for me. Thanks Lisp File: (defun c:cgrid () (setvar "cmdecho" 0) (setq DCL_ID (load_dialog "CGRID.DCL")) (if (not (new_dialog "cgrid" DCL_ID)) (exit)) (action_tile "grid_1" "(setq GRID \"clg_2x2\")") (action_tile "grid_2" "(setq GRID \"clg_2x4\")") (action_tile "ang_1" "(setq ANG \"0\")") (action_tile "ang_2" "(setq ANG \"45\")") (action_tile "ang_3" "(setq ANG \"90\")") (action_tile "ang_4" "(setq ANG \"135\")") (action_tile "object" "(setq SEL 1)(done_dialog 4)") (action_tile "point" "(setq SEL 2)(done_dialog 4)") (action_tile "edit" "(setq SEL 3)(done_dialog 4)") (setq DO_NEXT (start_dialog)) (unload_dialog DCL_ID) (if (= DO_NEXT 4) (progn (if (= SEL 1) (progn (setq OBJ (ssget)) (setq PT (getpoint "\nSelect starting point of grid:")) (setq XCORD (car PT)) (setq YCORD (cadr PT)) (setq SP (list XCORD YCORD)) (setvar "snapbase" SP) (command ".bhatch" "p" GRID "1.0" ANG "s" OBJ "" "") (command "snapbase" "0,0") ) ) (if (= SEL 2) (progn (setq PNT (getpoint "\nPick internal point:")) (setq PT (getpoint "\nSelect starting point of grid:")) (setq XCORD (car PT)) (setq YCORD (cadr PT)) (setq SP (list XCORD YCORD)) (setvar "snapbase" SP) (command ".bhatch" "p" GRID "1.0" ANG PNT "") (command "snapbase" "0,0") ) ) (defun rtd (A) (/(* A 180.0) PI) ) (if (= SEL 3) (progn (setq EROB (entsel "\nSelect ceiling grid to edit:")) (setq GRID (entget (car EROB))) (setq RAD (assoc 52 GRID)) (setq RAD (cdr RAD)) (setq GRID (assoc 2 GRID)) (setq GRID (cdr GRID)) (setq PT (getpoint "\nPick new starting point:")) (setq XCORD (car PT)) (setq YCORD (cadr PT)) (setq SP (list XCORD YCORD)) (setvar "snapbase" SP) (setq OBJ (ssget)) (setq ANG (rtd RAD)) (command ".erase" EROB "") (command ".bhatch" "p" GRID "1.0" ANG "s" OBJ "" "") (command "snapbase" "0,0") ) ) ) ) (princ) ) ;;END CGRID.LSP DLC File: cgrid : dialog { label = "Reflected Ceiling"; spacer_1; : row { : boxed_radio_column { label = "Ceiling Grid Size..."; : radio_button { label = "24in. x 24in. (Suspended Ceiling OR Access Floor)"; key = "grid_1";} : radio_button { label = "24in. x 48in. (Suspended Ceiling)"; key = "grid_2";} } } spacer_1; : row { : boxed_radio_row { label = "Grid Angle..."; width = 20; : radio_button { label = "0"; key = "ang_1";} : radio_button { label = "45"; key = "ang_2";} : radio_button { label = "90"; key = "ang_3";} : radio_button { label = "135"; key = "ang_4";} } } spacer_1; : boxed_radio_row { label = "Boundary Options..."; : button { label = "Select Polyline"; key = "object"; width = 16; fixed_width = true;} : button { label = "Pick Internal Point"; key = "point"; width = 20; fixed_width = true;} : button { key = "edit"; label = "Edit Start point"; width = 16; fixed_width = true;} } ok_cancel; } CGRID.zip Quote
The Buzzard Posted February 26, 2009 Posted February 26, 2009 Not sure if the attached is what you are looking for, But give it a try. Good Luck, The Buzzard CFT.zip Quote
cadmando2 Posted February 27, 2009 Author Posted February 27, 2009 I tried this program at work and every time I select my own starting within the side area of the room it wouldn't start where I place it, But when I just tryed it on my home PC and it works. I'm going to have to look at my setting. It is funny that every time I tryed it at work, it would not work on AutoCAD 2008. But in AutoCAD 2004 it works fine. something is setup different in AutoCAD 2008. Any one have any idea's? Thanks Quote
The Buzzard Posted February 27, 2009 Posted February 27, 2009 cadmando2, Not sure what would prevent it from running. I tested it in 2004 & 2009 and it works fine in both. Make sure you have the latest service packs for 2008. Other then that, I have no idea what would cause the problem. Let me know what you found when you get it working. The Buzzard Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.