Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
FacebookGroupMember
1018 Views, 14 Replies

Is there a way to get Material size (WxLxH) by using iLogic?

Is there a way to get Material size (WxLxH) by using iLogic?

What do you mean?for what purpose? You can get it in ilogic by naming dimensions etc? And ilogic can pull it from there

For sheet metal you can calculate bounding box for sheet usage but I would search for something like bounding box calculation for inventor parts?

We need the material size (W x L x H) or (Dia x L) to be automatic updated and shown on idw (title block) for our machine shop.

Philip Jintes You can rename the Parameters in the model, export them (tick box within the Parameters window) and then pull them through on the drawing either manually or using iLogic.

Create the named parameters in a template, set them to export and use iproperty "stock number" to create your material reference. Add "stock number" to your drawing template

https://www.cadlinecommunity.co.uk/hc/en-us/articles/360015106038-Inventor-Parameter-driven-iPropert...

Dan Goodrich Perfect solution :ok_hand:

Tnx for the replies, i will check tomorrow what works for me...

Yes, this can be done easily in iLogic. Go to Snippets-Measure-ExtentsLength, Width, and Height.

Another approach is to use OrientedBox properties in API. Here is some discussion. https://forums.autodesk.com/t5/inventor-ideas/overall-bounding-box-size-of-part-or-assembly/idi-p/67...

Johnson Shiue
I found the code below but the values come up as 0.

Dim oLength As Decimal
Dim oHeight As Decimal
Dim oWidth As Decimal
oLength = Round(Measure.ExtentsLength,2)
oHeight = Round(Measure.ExtentsHeight,2)
oWidth = Round(Measure.ExtentsWidth,2)
Dim SLength As String = oLength.ToString()
Dim SHeight As String = oHeight.ToString()
Dim SWidth As String = oWidth.ToString()
iProperties.Value("Custom", "Length") = SLength
iProperties.Value("Custom", "Height") = SHeight
iProperties.Value("Custom", "Width") = SWidth

Philip Jintes yes it’s possible we are doing that!

Daniel Cuperus would you like to share how you do it?

Dan Goodrich Good solution! But its not the automatic solution im looking for.

Yes you can do it with Range box using Inventor API and iLogic and Save them either to parameters or iProperties.

Use
RangeBox.MaxPoint and RangeBox.MinPoint methods to achieve the same.

I would also advise to google it as there is already a blog available.