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

Flipping a flat pattern in sheet metal part

When I enter a drawing made from a sheet metal part, inventor always defaults the flat pattern to have all the bends going down.  I actually need the bends coming in as 'up' instead. Is there any way to automate this ?

bradeneuropeArthur
in reply to: Anonymous

You know that you can change that in the flat-pattern definition within inventor!?

bradeneuropeArthur_0-1614755776893.png

Or do you need it with coding?

And do you need it in i-logic; VBA; Vb.net; or else?

 

Regards

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas: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 !

Anonymous
in reply to: bradeneuropeArthur

Yes, I do it manually every time as of now. Trying to automate processes for my company.  Preferably ilogic.  Will try to incorporate this with a code that streamlines most of the process of making drawings.

bradeneuropeArthur
in reply to: Anonymous

Dim a As Inventor.PartDocument = ThisDoc.Document
'Dim su As Inventor.DocumentTypeEnum = a.DocumentSubType

If a.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
	Dim s As Inventor.SheetMetalComponentDefinition = a.ComponentDefinition
	Dim f As Inventor.FlatPattern = s.FlatPattern
	'f.FlatPatternOrientations.ActiveFlatPatternOrientation.FlipAlignmentAxis
	Dim fl As Inventor.FlatPatternOrientation = f.FlatPatternOrientations.Item(1)
	fl.FlipBaseFace= True
	
	'MsgBox ("")
	End If

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas: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 !

Or use this to flip it back an forward:

 

Dim a As Inventor.PartDocument = ThisDoc.Document


If a.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
	Dim s As Inventor.SheetMetalComponentDefinition = a.ComponentDefinition
	Dim f As Inventor.FlatPattern = s.FlatPattern

	Dim fl As Inventor.FlatPatternOrientation = f.FlatPatternOrientations.Item(1)
	If fl.FlipBaseFace = False Then
		fl.FlipBaseFace = True
		ElseIf fl.FlipBaseFace = True
			fl.FlipBaseFace= False
		End If

	End If

 

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas: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 !

Anonymous
in reply to: bradeneuropeArthur

Looks great, would you happen to know if this rule can be run from a drawing ?  It is usually in the drawing where my coworkers notice that the part needs to be flipped. (The majority of the bends need to be up instead of down).

bradeneuropeArthur
in reply to: Anonymous

sure it can hang on..

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas: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 !

Dim dwg As Inventor.DrawingDocument = ThisDrawing.Document

Dim v As Inventor.DrawingView = dwg.ActiveSheet.DrawingViews.Item(1)
'v.ReferencedDocumentDescriptor.ReferencedDocument
Dim a As Inventor.PartDocument = v.ReferencedDocumentDescriptor.ReferencedDocument 'ThisDoc.Document


If a.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then

	Dim s As Inventor.SheetMetalComponentDefinition = a.ComponentDefinition
	Dim f As Inventor.FlatPattern = s.FlatPattern

	Dim fl As Inventor.FlatPatternOrientation = f.FlatPatternOrientations.Item(1)
	If fl.FlipBaseFace = False Then
		fl.FlipBaseFace = True
		ElseIf fl.FlipBaseFace = True
			fl.FlipBaseFace= False
		End If
dwg.Update
	End If

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas: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 !

More user friendly with a Picker selection from the user:

Dim dwg As Inventor.DrawingDocument = ThisDrawing.Document

Dim v As Inventor.DrawingView '= dwg.ActiveSheet.DrawingViews.Item(1)
v = ThisApplication.CommandManager.Pick(Inventor.selectionfilterenum.kDrawingViewFilter,"Select a Flat Pattern View")
Dim a As Inventor.PartDocument = v.ReferencedDocumentDescriptor.ReferencedDocument 'ThisDoc.Document


If a.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then

	Dim s As Inventor.SheetMetalComponentDefinition = a.ComponentDefinition
	Dim f As Inventor.FlatPattern = s.FlatPattern

	Dim fl As Inventor.FlatPatternOrientation = f.FlatPatternOrientations.Item(1)
	If fl.FlipBaseFace = False Then
		fl.FlipBaseFace = True
		ElseIf fl.FlipBaseFace = True
			fl.FlipBaseFace= False
		End If
dwg.Update
	End If

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas: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 !

Next the error will occur when the View is no Flat Pattern view:

Now you receive a message if it is not:

Dim dwg As Inventor.DrawingDocument = ThisDrawing.Document

Dim v As Inventor.DrawingView '= dwg.ActiveSheet.DrawingViews.Item(1)
v = ThisApplication.CommandManager.Pick(Inventor.selectionfilterenum.kDrawingViewFilter, "Select a Flat Pattern View")

If v.IsFlatPatternView = True Then
Dim a As Inventor.PartDocument = v.ReferencedDocumentDescriptor.ReferencedDocument 'ThisDoc.Document


If a.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then

	Dim s As Inventor.SheetMetalComponentDefinition = a.ComponentDefinition
	Dim f As Inventor.FlatPattern = s.FlatPattern

	Dim fl As Inventor.FlatPatternOrientation = f.FlatPatternOrientations.Item(1)
	If fl.FlipBaseFace = False Then
		fl.FlipBaseFace = True
		ElseIf fl.FlipBaseFace = True
			fl.FlipBaseFace= False
		End If
dwg.Update

	End If
Else 
	MsgBox("This View Contains no Flat Pattern")
	End If

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas: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 !

Anonymous
in reply to: bradeneuropeArthur

Thanks, code will be used !