sheet metal flat pattern length and width

sheet metal flat pattern length and width

Anonymous
Not applicable
315 Views
3 Replies
Message 1 of 4

sheet metal flat pattern length and width

Anonymous
Not applicable
i would like to grab the sheet metal extent flat pattern length and width and use them .

is there a way to grab these in an addin

which object

any ideas
0 Likes
316 Views
3 Replies
Replies (3)
Message 2 of 4

arrakisman
Enthusiast
Enthusiast
This is from another post from a while back but it should work.

Dim odoc As Inventor.DrawingDocument
Set odoc = ThisApplication.ActiveDocument
Dim oview As DrawingView
Set oview = odoc.ActiveSheet.DrawingViews.Item(1)
Dim oDVRFile As ReferencedFileDescriptor
Set oDVRFile = oview.ReferencedFile
Dim oReffile As Document
Set oReffile = oDVRFile.ReferencedDocument
Dim oFlatPattern As FlatPattern
Set oFlatPattern = oReffile.ComponentDefinition.FlatPattern

' Get the custom property set.
Dim oCustomPropSet As PropertySet
Set oCustomPropSet = odoc.PropertySets.Item("User Defined Properties")

' Check to see if the flat exists.
If Not oFlatPattern Is Nothing Then
' Get the extent of the face.
Dim oExtent As Box
Set oExtent = oFlatPattern.Body.RangeBox
End If


' Extract the width and length from the range.
Dim dLength As Double
Dim dWidth As Double
dLength = oExtent.MaxPoint.x - oExtent.MinPoint.x
dWidth = oExtent.MaxPoint.y - oExtent.MinPoint.y

Ed Jackson
0 Likes
Message 3 of 4

Anonymous
Not applicable
thank you

another dumb question

where do i put the code
do i put it in a subroutine in my addin
or do i make a module in inventor

i guess i am stuck figuring out how to hook into the event that i need to attach the code to
i want to get the length and width when it is being saved

where would i do that

thanks in advance
0 Likes
Message 4 of 4

Anonymous
Not applicable
Dear Ed Jackson,


If you explain how to use it and where the sheet metal extent listed. I copied and pasted code in "thisDocument" But still I didn't get It.
Thanks In advance.


Nandakumar hegde
0 Likes