- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to create Flat Patern of one opened Sheet metal and save it in this pattern:
Stock Number " " Thickness " " Material
The code works to save DXF (It is a remake of code that saves all assembly parts to DXF), the problem is in the naming. I can't seem to change the sFName to name in needed pattern.
Can you help me with this?
Sub Main()
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Dim oCompDef As SheetMetalComponentDefinition
oCompDef = oDoc.ComponentDefinition
If oCompDef.HasFlatPattern = False Then
oCompDef.Unfold
Else
oCompDef.FlatPattern.Edit
End If
Dim sOut As String
sOut = "FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=IV_INTERIOR_PROFILES"
' Get document's full file name
Dim sFname As String
sFname = oDoc.FullFileName
' The file format will depend on the extension
' Set file name extension to ".DXF"
sFname = Left$(sFname, Len(sFname) - 3) & "dxf"
oCompDef.DataIO.WriteDataToFile( sOut, sFname)
End Sub
Solved! Go to Solution.