Results 1 to 7 of 7

Thread: getting 3dSolid Box properties using VBA...

  1. #1
    Join Date
    Jun 2009
    Posts
    3

    getting 3dSolid Box properties using VBA...

    Hello!
    The problem is:
    When i create a Box, then select it and click right mouse button and select properties menu, the window called Propertoes is displayed. This window have information about the box that is selected such as Length, heigh, width and so on...
    So i need to write VB application where i can store this parameters. I need to do this only with Box objects that are free oriented in a ModelSpace.
    Thank you for your advices!

  2. #2
    Join Date
    Aug 2009
    Posts
    11
    Quote Originally Posted by 99garry View Post
    Hello!
    The problem is:
    When i create a Box, then select it and click right mouse button and select properties menu, the window called Propertoes is displayed. This window have information about the box that is selected such as Length, heigh, width and so on...
    So i need to write VB application where i can store this parameters. I need to do this only with Box objects that are free oriented in a ModelSpace.
    Thank you for your advices!
    Gee Garry, you posted this a while ago. Did you find a solution? I am truly a beginner, so I have no clue as how to save this data.

  3. #3
    Join Date
    Jun 2009
    Posts
    3
    Quote Originally Posted by BCP View Post
    Gee Garry, you posted this a while ago. Did you find a solution? I am truly a beginner, so I have no clue as how to save this data.
    Well, you have no clue as how to save what kind of data?
    I mean: what kind of data you can not save?
    And, it is pitifully, but i have not find a solution to my problem.

  4. #4
    Join Date
    Jun 2004
    Location
    Anchorage, Alaska
    Posts
    1,179
    I see you posted on Cadtutor in June; Seant posted some code but not sure if that was helpful...

    Could you use the properties you can retrieve, use them to calculate thebox's length/width/height?
    For example, *if* boxes are aligned with x-y axis, you can use "get bounding box" to get length & width. From the "volume" property you could then calculate the height.

  5. #5
    Join Date
    Jun 2009
    Posts
    3
    Quote Originally Posted by CarLB View Post
    I see you posted on Cadtutor in June; Seant posted some code but not sure if that was helpful...

    Could you use the properties you can retrieve, use them to calculate thebox's length/width/height?
    For example, *if* boxes are aligned with x-y axis, you can use "get bounding box" to get length & width. From the "volume" property you could then calculate the height.
    The problem is that i need length width and high of the box that are displayed in the object properties window. This numbers can be different of the values i can calculate using Seants calculation method.
    I am trying to say, that width lenght and high are already calculated in the AutoCad drawing, and i want this values, i don need to calculate them.

  6. #6
    Join Date
    Jun 2004
    Location
    Anchorage, Alaska
    Posts
    1,179
    Did you reply to Seant that results from his routine were different than AutoCAD reports? Perhaps he could easily fix, or maybe he just posted an example he thought you might be able to customize. As Seant said, there is not a Vla method to directly get the length/width/height, thus further calculations & manipulations were necessary. This is where "thinking outside the box" is helpful

    Another idea-as you note, "properties" or even "list" will give you the desired information. So you can devise a way to retrieve that. A routine could turn logfile on, do a "list" on a box, turn logfile off, read the file created, and by stepping through the text file, find the results you need. Not too difficult to do this (in Lisp anyway which I've used).

  7. #7
    Join Date
    Jul 2006
    Posts
    15
    Just noticed this thread. Here is the CadTutor post mentioned by CarlB:

    http://www.cadtutor.net/forum/showthread.php?t=37494


    Some of the comment posted here prompted me to look again at that routine. 99garry, how is the returned data not matching that shown in the properties box? Is it just the order?

    My tests show the general sizes to be correct, though may not match the same association to Length, Width, and Height as shown by the Properties Window. Conceivably, AutoCAD keeps track of the order based on the original creation sequence, so I can see how that info may be germane to a workflow.

    I don’t think it is within the VBA API capabilities to retrieve that ordered information unless, as mentioned by Carl, some Command: LIST data parsing procedure is employed.

    One advantage the posted routine has over the Properties Window and/or List command is the ability to retrieve data from solids that have lost their “Box” status (i.e., have undergone a BREP or SLICE command)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •