Jump to content

Ceiling Grid lisp not working right


cadmando2

Recommended Posts

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

Link to comment
Share on other sites

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. :oops:

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.:huh:

something is setup different in AutoCAD 2008.

Any one have any idea's?

Thanks

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...