Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Minimum Bounding Box of non-aligned Parts

Minimum Bounding Box of non-aligned Parts

Dear all,
to calculate the dimensions of a part in an automatic process you can use the bounding box to get the length, width and height. But this only works correctly for parts which are aligned to the XYZ planes.


It would be really nice if there was a feature which allows us to get the minimum bounding box of non-aligned (rotated) parts to get the length, width and height in an automatic process. Since master sketches are used it is not possible to just align those parts to be able to use the normal bounding box.


Example of a non-aligned part with the wanted dimensions highlighted:

demo.png

 

 

25 Comments
inv.ideareview
Autodesk
Status changed to: Gathering Support

@thomas_jamnik, we may consider to use move body command to rotate the body to the expected position, and the bounding box should be expected. You could use movefeature API to rotate the body. 

Hope it helpful for you!

MoveBody.PNG

thomas_jamnik
Contributor

Hello 

Thank you for your suggestion. To rotate or relocate the position of the body is no option for us because as I wrote we use master sketches. Maybe temporary it is possible but we do not know the rotate axis. So manual input is needed. But as I wrote we need an automatic process for that.

 

BR, Thomas

jtylerbc
Mentor

We use the Direct Edit feature for this in some cases.  Its "Snap Parallel" option makes it such that you don't actually need to know the rotation angle.

 

If this was from a multisolid, it does have the unfortunate side effect that the part must be manually constrained, rather than just grounded at the origin, since the orientations of the part and the solid in the master part no longer align.  It's not a huge problem for us though, since this is a process that is only needed occasionally.

DRoam
Mentor

Multi-body and skeletal modeling lead to parts that are not aligned to the coordinate system all the time, and using Direct Edit or other methods to re-orient them is not a good solution, because this undermines the purpose of using those modeling strategies in the first place.

 

A good solution would be if we could create a special UCS (user coordinate system) and tell Inventor to use it (in as many ways as possible) as the Part's coordinate system. This would affect the View Cube, the default orientation for new Sketches, the starting orientation for Drawing Views, etc., and, of course, the bounding box/extents measurements.

 

Basically, an "override" coordinate system for mis-aligned parts that makes more sense for the Part individually, but leaves its global Origin and relative location/orientation untouched.

Please see also the following.

Regards,

Dimension Component! |

Regards

gilsdorf_e
Collaborator
kmiller
Collaborator

We also could use this.  I have not found a fool proof way to code and get an accurate representation of the piece sizes.  We have come close with testing different solutions provided and using drawing view sizes to try to get around the rotation issue.  But the minute you add any radial type work to the piece, curve/fillet/round, the accuracy of these is shot out the window (with the drawing views idea anyway).  Then going to the part, you have the rotation issue if the piece is not aligned with the ucs.  Which we also do solid bodies/skeletal modeling so things are not aligned.  I have searched but have not found anything that did not have an exception or provide a good solid accurate solution.  Does anyone?    Or even be able to provide the steps needed to create one?

jtylerbc
Mentor

@kmiller,

 

The method I described in my previous post gives very reliable results.  However, it is not ideal because it requires the manual secondary processes of rotating the body so it actually is aligned with the coordinate system, as well as manually constraining it afterward.

 

We now have a macro that helps us out with reorienting the body.  However, the way it is coded doesn't always apply nicely with a particular part, so in those cases we just use Direct Edit to do it ourselves.

DRoam
Mentor

There are a couple of workarounds that I can think of.

 

1. Convert your derived un-aligned part to a Sheet Metal part, and use iLogic to write the flat pattern extents as your part size.

 

This relies on a few things to work correctly. First, you'll need to find some way of measuring the thickness, and setting the Thickness parameter to it, so that the Flat Pattern still generates correctly if your part's thickness changes. iLogic may be the best option for this.

 

Second, you'll need to make sure that the orientation of the Flat Pattern is correctly aligned with the part. I'm not sure if it would be possible to reliably automate getting this correct, but iLogic would probably be your best bet here, too.

 

2. Create work geometry on the part that you can use iLogic to measure between.

 

This is a lot of manual work, but if you can create the work geometry such that it's unlikely to "break" or be at the wrong location after the types of design changes you expect to be making to the part, then it may be robust enough to be worth it.

 

Neither of these is great, but number 1 is probably a realistic option if you can figure out a good way to deal with the two points I mentioned.

kmiller
Collaborator

Thanks for the suggestions.  "1" doesn't sounds like it will work the best for us since our parts are all random thicknesses.  We aren't just dealing with plywood, or sheet metal, etc... so not even a standard set of 10 thicknesses.  All custom.  But.  I will still definitely look at the options and all suggested work flows. 

 

I tried for while muddling my way through the sample code on this post: 

https://forums.autodesk.com/t5/inventor-customization/getting-accurate-rangebox-xyz-values/td-p/8332...

 

I got part of it to work after adjusting a few things.  But not all of it just yet (the middle section from where it's getting the longest edge - through the constraints area).  So I am not able to determine if this is a feasible solution. 

 

I can't imagine what we are asking to do, is uncommon.  Not with the number of different posts out there.  Just fairly complicated?

DRoam
Mentor

Yeah sorry about that, I thought about that after I posted. Sheet metal would only work reliably for parts with uniform thickness.

 

Hmm, that code sounds interesting, but it sounds like it wouldn't work for parts where there's not an edge that spans the entire length of the part (which is probably pretty common).

 

I would assume, the best/most robust solution with current tools is going to be to manually define a UCS in the Part, and then write an iLogic rule that's able to do the coordinate system transformation math between the UCS and the WCS, and then use Move Body to rotate the body to be aligned to the WCS, then measure the extents, then delete the Move Body feature.

 

 

 

As for this being common, I definitely think you're right. Many people have developed custom solutions for writing the size of parts to the part's iProperties, for use in the BOM and other places. But non-aligned parts are a particularly stubborn problem to solve.

jtylerbc
Mentor

@DRoam and @kmiller,

 

The sheet metal thickness issue is fairly easy to solve if the part has a uniform thickness.  Just link whatever parameter is driving the thickness in the multisolid layout part, and set then the "Thickness" parameter equal to it.  This will handle applications like plate steel fabrication pretty well.

 

Obviously, it's no help if the part is not uniform in thickness, since that will prevent Inventor from making the flat pattern anyway.  But it may be an option for some people if their application allows it. 

 

 

 

 

dan_szymanski
Autodesk
Status changed to: Future Consideration

Idea added to backlog for future consideration [33538]. Thanks!

DRoam
Mentor

Awesome! That's really exciting! Thanks for considering this one!

kmiller
Collaborator

Yes thank you.  We ended up just using the drawing view sizes along with the scale of the view to pull the dimensions from it. Stuff with double radii or complex shapes just don't calculate correctly so we made it a training issue with the option to override the automation within a custom program.  So not 100% ideal, but pretty decent for the percentage of work that we do.  

thomas_jamnik
Contributor

Hello 
Thank you for considering this. It will really help us if this functionality will be supported out of the box.

DRoam
Mentor

@dan_szymanski, very excitingly, I think this one could be marked as implemented thanks to the "SurfaceBody.OrientedMinimumRangeBox" method that was implemented in 2020.3/2021. 🙂

 

Unless you're holding out for it to be exposed in the UI somewhere, but I think that might be covered by this idea: Overall Bounding Box Size of Part or Assembly, as long as you add both the orthogonal and oriented-minimum bounding box sizes when implementing that one.

DRoam
Mentor

For anyone interested, I posted a sample code of how to use the new minimum bounding box here: Re: Getting accurate RangeBox XYZ values.

 

As I said there, thanks to the Inventor team for getting this implemented! And feel free to brag a bit more loudly about cool little things like this 😉

dan_szymanski
Autodesk

@DRoam, Yes I was holding out for a more elegant user interface. As you mention, thankfully the API is there for those who need it now. -Dan

Hi,

 

Any idea how to use this for assemblies too?

 

Regards,


Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Dimension Component! | Partlist Export! | Derive I-properties! | Vault Prompts Via API! | Vault Handbook/Manual!
Drawing Toggle Sheets! | Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Autodesk Design & Make Report