Jump to content

Create box that contains everything?

Recommended Posts

Is there a command or Lisp routine that creates a 3dbox which sides are adjacent to a drawing? Something like a 3d boundary-space that contains everything you might have created..

Link to comment
Share on other sites

EXTMAX & EXTMIN are the values of your drawing in a plan view not sure if theres extz


(setq pt1 (getvar "extmin")

(setq pt1 (getvar 'extmax")

(command "rectang" pt1 pt2)


then extrude or thickness

Link to comment
Share on other sites

Extmax & extmin gives you the bounding box values including z's -20,-20,-10 821,574,50


(setq pt1 (getvar "extmax")) (setq pt1x (car pt1)) (setq pt1y (cadr pt1)) (setq pt1z (caddr pt1))

(setq pt1new (list pt1x pt1y))

(setq pt2new (list pt2x pt2y))

rectang 2d points then extrude z height. can be done easy

Link to comment
Share on other sites

Based on BIGAL's idea, here's a simple lisp :


; 3dbe.lsp - 3D bounding box using Extrude command

(defun c:3dbe (/ osave ce pmax pmin pmaxx pmaxy pmaxz pminx pminy pminz)
(setq osave (getvar "OSMODE"))
(setvar "OSMODE" 0)
(setq ce (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(setq pmax (getvar "EXTMAX"))
(setq pmin (getvar "EXTMIN"))
(setq pmaxx (car pmax) pmaxy (cadr pmax) pmaxz (caddr pmax))
(setq pminx (car pmin) pminy (cadr pmin) pminz (caddr pmin))
(command "._RECTANGLE" (list pminx pminy pminz) (list pmaxx pmaxy pminz))
(command "._EXTRUDE" (entlast) "" (abs (- pmaxz pminz)) 0)
(setvar "CMDECHO" ce)
(setvar "OSMODE" osave)

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.

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