Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Solids 3D - AutoCAD

15 views
Skip to first unread message

Ari Monteiro

unread,
Sep 19, 2002, 6:39:46 PM9/19/02
to
Hello,

I would like know, how can I access the measures of a 3D Box through
AutoLISP. I need one solution that work in AutoCAD R14 and 2000. I need the
follow information of a 3D Box:

1. Length
2. Width
3. Height
4. Rotation angle

Ari

Joe Funk

unread,
Sep 19, 2002, 10:44:01 PM9/19/02
to
Ari;
Here are some unsatisfactory ways that nevertheless I hope may help you:
-----------------------------------------------------------------------
For R14 or R2000+:

1. Set an UNDO Mark. Explode the solid box into REGIONs and then again into
LINEs and get the endpoints of the lines. UNDO Back to restore the solid.
... then use the endpoints to calculate the Length, Width, Height, and
Rotation angle.

2. Use Owen Wengerd's acis-decode and Vladimir Nesterovky's (c:solid-out)
to find the endpoints. The following is quoted from Vlad's email on this
newsgroup 2002-02-09:
...
Newsgroups: comp.cad.autocad
Subject: Re: R13 3D Solids
Date: Fri, 08 Nov 1996 14:55:28 GMT

ow...@manusoft.com (Owen Wengerd) has posted
this version on c.c.a. :
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ACISdecode (st / ln n c st1)
(setq st1 "" n (strlen st))
(while (> n 0)
(setq c (ascii (substr st n 1)))
(setq st1
(strcat
(cond
((= c 32) " ")
((= c 86) "I")
((chr (boole 6 c 95))))
st1))
(setq n (1- n)))
st1
)
...
(defun c:solid-out(/ e d fd)
(cond
((and
(setq e (car (entsel)))
(setq d (entget e))
(= "3DSOLID" (cdr (assoc 0 d)))
(setq fd (open "solid.out" "w")))
(foreach g d
(and (= 1 (car g))
(princ (ACISdecode (cdr g)) fd)
(princ "\n" fd)))
(close fd)
(findfile "solid.out"))))
http://vnestr.tripod.com/
...
In the text file "solid.out" you'll find the same basic information as
would be found in an R2000 WBlock xml file. For specifications on the
ACIS/SAT file, look for Public Documentation at
<http://www.spatial.com/services_support/support/Technical/docs.html?LV3=Y>

-----------------------------------------------------------------------
For R2000+ only - 2 more ways:
1. WBlock the box out as an xml file then read the xml file (which is ASCII
text), looking for the 8 lines labelled "point $-1 <x><y><z>" between the
opening and closing headers.

2. Or use my patchy acis-peeps.vlx (See customer-files) which uses Owen's
acis-decode. It returns some info for primitive solids. I haven't compiled
it for R14 yet.

Joe

"Ari Monteiro" <ari....@bol.com.br> wrote in message
news:876F66B5BD430779...@in.WebX.maYIadrTaRb...

0 new messages