Author Topic: 3dsolid values  (Read 3981 times)

0 Members and 1 Guest are viewing this topic.

DEVITG

  • Bull Frog
  • Posts: 480
3dsolid values
« on: April 23, 2006, 09:07:24 PM »
How can I get the lenght , wide, and height vbalues of a 3dsolid cube , not a true cube, as the dwg attached?

Thank in advance , [TIA]


 
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

Tom

  • Guest
Re: 3dsolid values
« Reply #1 on: April 24, 2006, 02:17:01 AM »
One way is Try Massprop
set your UCS origin to bottom Left Hand corner use Massprop and
the Bounding box should be the Values your looking for

DEVITG

  • Bull Frog
  • Posts: 480
Re: 3dsolid values
« Reply #2 on: April 24, 2006, 08:24:05 AM »
That is a way , I will try it .

Thanks
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

Tramber

  • Guest
Re: 3dsolid values
« Reply #3 on: April 24, 2006, 09:10:08 AM »
There is a lisp that extracts informations from the solid shapes (previous to 2007)

I'm searching....
« Last Edit: April 24, 2006, 09:24:42 AM by Call me Bert' »

Tramber

  • Guest
Re: 3dsolid values
« Reply #4 on: April 24, 2006, 10:01:15 AM »
Are you Ok to Autolisp it ? or not.

DEVITG

  • Bull Frog
  • Posts: 480
Re: 3dsolid values
« Reply #5 on: April 24, 2006, 12:45:45 PM »
I got  it from Fatty .

Code: [Select]
(defun c:bxz(/ adoc hgt len maxpt minpt obj util wid)
(vl-load-com)
  (setq adoc (vla-get-activedocument
        (vlax-get-acad-object)
      )
  )
 
  (setq util (vla-get-utility adoc))
  (vla-endundomark
    adoc
  )
  (vla-startundomark
    adoc
  )
  (prompt "\nSelect entities to add in block\n")
  (setvar "osmode" 1)
 
  (command "ucs" "N" "3"
    (getpoint "\nSpecify new UCS origin point\n")
    (getpoint "\nSpecify point on positive X direction\n")
    (getpoint "\nSpecify point on positive Y direction\n"))
  (vla-getentity util 'obj 'pt "\nSelect the box\n")
  (vla-getboundingbox obj 'minpt 'maxpt)
  (setq minpt (vlax-safearray->list minpt))
  (setq maxpt (vlax-safearray->list maxpt))
  (setq len (abs (- (car maxpt )(car minpt)))
 wid (abs (- (cadr maxpt )(cadr minpt)))
 hgt (abs (- (caddr maxpt )(caddr minpt))))
  (if (< len wid)
    (progn
      (setq len1 wid)
      (setq wid1 len))
    (progn
      (setq len1 len)
      (setq wid1 wid)))
  (alert (vl-princ-to-string
    (strcat
    (strcat "Length: " (rtos len1) "\n")
    (strcat "Width: " (rtos  wid1) "\n")
    (strcat "Height: " (rtos hgt) "\n"))))
  (command "ucs" "P")
  (princ)
  )
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

Tramber

  • Guest
Re: 3dsolid values
« Reply #6 on: April 24, 2006, 02:13:05 PM »
Yes, it is good, but it has to be done in regard with a "normal" UCS, because it uses the bounding boxof the object.

Here you can find how to read the ACIS code of an object.

But I'm sure you'll prefer your lisp  :lmao:

If you are on 2007, be aware that Length, width and height are values that can be read even more easily, in the properties or through a simple lisp
Quote
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.

Isn't that last solution brilliant ? (but only works in old version, I think)
« Last Edit: April 24, 2006, 02:27:07 PM by Call me Bert' »

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: 3dsolid values
« Reply #7 on: April 26, 2006, 04:16:53 AM »
If you can store 1, 2 or 3 'world points' (group code 1013) as xdata on the object at creation time. If you simply need the length, just store a vector for the 'z' or extrusion direction. If you store only 2 you can produce the 3rd using the cross product of these 2 vectors, or store all three. The beauty of this is the xdata is copied and updated with modifications to the 3d solid object.
To get these values you will need to construct a matrix out of these 3 vectors, transform the object to world and get it's bounding box values then 'invert' the matrix to put the object back.

Perhaps for existing objects (that don't have this data) the user can pick these directions and they can then be stored for extraction later.

Have fun!
« Last Edit: April 26, 2006, 04:20:22 AM by MickD »
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien