Flat Patterns

Flat Patterns

Anonymous
Not applicable
663 Views
5 Replies
Message 1 of 6

Flat Patterns

Anonymous
Not applicable

is there a rule to create a flat model and export it to dxf for the cam?

0 Likes
664 Views
5 Replies
Replies (5)
Message 2 of 6

JelteDeJong
Mentor
Mentor

hi @Anonymous worte an article about this on his site. Also i wrote an article about extra layers you can add to the export. (some software want that). check this.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 6

Anonymous
Not applicable
Dim oDoc As Inventor.PartDocument = ThisDoc.Document
Dim oPath As String = ThisDoc.Path
Dim oDef As Inventor.SheetMetalComponentDefinition = oDoc.ComponentDefinition

If oDef.FlatPattern Is Nothing Then 
	oDef.Unfold
End If
Dim ModelDisplayName As String = oDoc.DisplayName
Dim YourPath As String = oPath & "\" & ModelDisplayName & ".dxf"
oDef.DataIO.WriteDataToFile("FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=IV_OUTER_PR​OFILE", YourPath)
oDef.FlatPattern.ExitEdit

This will create dxf file with name of your sheetmetal file and in the same folder.

0 Likes
Message 4 of 6

baliasM74U3
Advocate
Advocate

Would you be able to explain this code for me. I dont have any programming knowledge . 

0 Likes
Message 5 of 6

Anonymous
Not applicable

First of all this is an ilogic rule and should be run from part-sheetmetal file.

I added some comments:

'Declaring document
Dim oDoc As Inventor.PartDocument = ThisDoc.Document
'Path of your sheetmetal file
Dim oPath As String = ThisDoc.Path
'Definition of your component
Dim oDef As Inventor.SheetMetalComponentDefinition = oDoc.ComponentDefinition

'In case flat pattern does not exist yet - create one
If oDef.FlatPattern Is Nothing Then 
	oDef.Unfold
End If
'filename of your sheetmetal file without path and extension
Dim ModelDisplayName As String = oDoc.DisplayName
'Path and filename of new dxf file 
'I assumed that the file will have the path and name like your sheetmetal file
'You can change it if you like
Dim YourPath As String = oPath & "\" & ModelDisplayName & ".dxf"
'Exporting do dxf
oDef.DataIO.WriteDataToFile("FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=IV_OUTER_PR​OFILE", YourPath)
'back Folded Model in Inventor 
oDef.FlatPattern.ExitEdit

 

Message 6 of 6

baliasM74U3
Advocate
Advocate

Thanks Heaps. Lemme start with this.

0 Likes