FlatPattern thumbnail on BOM

FlatPattern thumbnail on BOM

jwoutersJC4LN
Enthusiast Enthusiast
773 Views
4 Replies
Message 1 of 5

FlatPattern thumbnail on BOM

jwoutersJC4LN
Enthusiast
Enthusiast

Hi, 

 

Is there any way to get an image of a sheet metal "flat pattern" on a BOM list?

 

Regards! 

0 Likes
774 Views
4 Replies
Replies (4)
Message 2 of 5

James_Willo
Autodesk
Autodesk

Yes, but it's not very easy.
Go to the flat pattern.
Open iProperties.
Go to Save.

Click 'active window'

Click 'Capture'

Click Appy/OK

Go back to folded model.

Save file. 

James_Willo_0-1726739468131.png

 



James W
Inventor UX Designer
0 Likes
Message 3 of 5

jwoutersJC4LN
Enthusiast
Enthusiast

Thanks so far. But this is not wat i'm looking for.. As i have a model with a few 100 sheetmetal parts, this cost to much time. Found an Ilogic rule online somewhere but that one is not working. It makes a new image and stored it somewhere. Maybe there's a code that can change it a bit ? If it have to store a picture, would be fine that it is in the part folder.

 

Hope to see your response!

 

‘ ——————-start of rule——————-

‘===================SETTINGS=======================
‘set the image width in pixels, height will be calculated based on actual Inventor window width/height ratio
Dim imageWidth As Integer
imageWidth = 200

‘set save folder. Specified folder should already exist!
Dim savePath As String
savePath = “c:\temp\”
‘===================/SETTINGS=======================

‘ref to application
Dim oApp As application
oApp = ThisApplication

‘switch to Flat Pattern or create one if it doesn’t exist (assumes you have SheetMetal component opened!)
Dim oPartDoc As partdocument
opartdoc = oApp.activedocument

Dim oCompDef As SheetMetalComponentDefinition
ocompdef = opartdoc.componentdefinition

If oCompDef.HasFlatPattern = False Then
oCompDef.Unfold
Else
oCompDef.FlatPattern.Edit
End If

‘get current view transition time
Dim ViewTransTimeCurrent As Double
ViewTransTimeCurrent = oApp.DisplayOptions.ViewTransitionTime

‘set view transition time to 0. Otherwise save happens before the zooming is finished
oApp.DisplayOptions.ViewTransitionTime = 0

‘zoom all
ThisApplication.CommandManager.ControlDefinitions.Item(“AppZoomallCmd”).Execute

‘get reference to active view
Dim oView As View
oView = oApp.ActiveView

‘get ratio between screen view width and height
Dim ratio As Double
ratio = oview.Height/oview.Width

‘calculate thumbnail height
Dim imageHeight As Integer
imageheight = CInt(imagewidth * ratio)

‘get component Part Number
Dim PartNumber As String
PartNumber = iProperties.Value(“Project”, “Part Number”)

‘compose full name of thumbnail
Dim imageFullFileName As String
imageFullFuleName = savepath & partnumber & “.png”

0 Likes
Message 4 of 5

Michael.Navara
Advisor
Advisor

Hi @jwoutersJC4LN 

If you want to see flat pattern in built-in BOM view, you need to update Thumbnail in each document. For this you can use PartDocument.SetThumbnailSaveOption method.

Now it depends on your workflow.

You can set thumbnail during the design process, when sheet metal part is saved and has flat pattern. 

Or you can update thumbnails at the end of design process when the design is finished.

 

In both cases you need to create image file with thumbnail and pass them as the second argument to SetThumbnailSaveOption method. 

For this you can use code mentioned above, or use some more efficient one.

0 Likes
Message 5 of 5

jwoutersJC4LN
Enthusiast
Enthusiast

Thanks for the information. As i'm not a programmer, i can't writing code.. So i understand which parameter is needed to set the thumbnail but i can't write that.. Is that something you can provide?

 

thanks!

0 Likes