Length, Heigth and Width drawing views

Hello, 

 

I am trying to build a macro that can add general dimensions (length, heigth and width) to our 3 drawing views. My current approach works well for dimensioning the longest edge of a view (typically width or length), but it fails to consistently capture the overall height in certain orientations (especially for the front or right views, depending on geometry). This is because the longest edge in the drawing view doesn't always correspond to the height.

 

Here is the macro I am using : 

 

Any tips, help or guidance will be very appreciated. Thanks

 

Answers 4
JS
JS 2025-06-12 Best Answer

I think there's a difference between the bounding box api (old and inaccurate) and the newer bounding box feature. The sizes I've seen from the feature are accurate. However, when creating the bounding box feature programmatically it's hard to control the orientation of the box.So if your parts are reliably designed with the max extents along the global x,y, and z axis then it should work.

DM
DM 2025-06-10

why not just use the bounding box ? 

MJ
MJ 2025-07-10

I did something similar with the GetExtremePoint-Class. you probably need to transform the direction of the normal into the correct direction (depending on how your part is designed):

 

JS
JS 2025-07-14

Regarding the extreme point method—this is the method we use. However, there are pluses and minuses. Plus: much more control since you can use coordinate systems to orientate the measurements. Minus: much more compute intensive on complicated models (on complicated models, the lag in computation is actually noticeable). Honestly, if we could figure out how to get the bounding box feature to handle the edge cases we’d use it. It’s always up-to-date, is way faster than extreme points, and is, so far as I can tell, just as accurate.