Create DXF using Apprentice

Create DXF using Apprentice

gustavoGGT
Enthusiast Enthusiast
635 Views
4 Replies
Message 1 of 5

Create DXF using Apprentice

gustavoGGT
Enthusiast
Enthusiast

Hi,

 

Does anybody know if the Inventor 2015 Apprentice supports the 'save as DXF ' for sheetmetal already?

 

Thanks in advance,

 

Guus de Groot 

0 Likes
Accepted solutions (1)
636 Views
4 Replies
Replies (4)
Message 2 of 5

raith-mb
Advocate
Advocate

Yes, it supports:

 

Public Sub IAM_DXF_Blech()  
'Export to IPT-Name.dxf
    ' Make sure a drawing document is active.
    On Error Resume Next
    
    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument


    For Each oRefedDoc In oDoc.AllReferencedDocuments
        'ist es ein Blechteil?
        'in der API: SheetMetalComponentDefinition
        'API-Übersicht: http://usa.autodesk.com/adsk/servlet/index?id=1079044&siteID=123112
        If oRefedDoc.ComponentDefinition.Type = kSheetMetalComponentDefinitionObject Then
            'MsgBox "Blechteil: " & oRefedDoc.FullDocumentName
           
            'Blech öffnen
            If fs.fileExists(oRefedDoc.FullDocumentName) = True Then
                ThisApplication.Documents.Open (oRefedDoc.FullDocumentName)
            End If
            Set BlechDoc = ThisApplication.ActiveDocument

            ' Get the DataIO object.
            Dim oDataIO As DataIO
            Set oDataIO = oRefedDoc.ComponentDefinition.DataIO
    
            Dim iptName As String
            iptName = oRefedDoc.FullDocumentName
            Dim dxfName As String
            dxfName = Left(iptName, Len(iptName) - 4) + ".dxf"
            'MsgBox "DXF-Name: " & dxfName
                         
            ' Build the string that defines the format of the DXF file.
            Dim sOut As String
            sOut = "FLAT PATTERN DXF?AcadVersion=R12&OuterProfileLayer=Outer"

            ' Create the DXF file.
            oDataIO.WriteDataToFile sOut, dxfName  '"C:\temp\flat2.dxf"
         
            'MsgBox "DXF-Zuschnitt gespeichert in: " & Chr(10) + Chr(13) & Chr(10) + Chr(13) & dxfName
           
            If ThisApplication.ActiveDocument.ComponentDefinition.Type = kSheetMetalComponentDefinitionObject Then
                ThisApplication.ActiveDocument.Close (True)
            End If
        End If 'oRefedDoc.DocumentType Is kPartDocumentObject
    Next
End Sub

 This function creates a ACAD-12 DXF with the same file name in the same folder.

 

Roland

0 Likes
Message 3 of 5

gustavoGGT
Enthusiast
Enthusiast

Roland, 

 

Thanks, but this not working for the Inventor Apprentice. Same problem as in previuous releases. 

 

Regards,

 

Guus de Groot

 

 

 

 

0 Likes
Message 4 of 5

Vladimir.Ananyev
Alumni
Alumni

Although this wish is confirmed, exporting to dxf from Apprentice is not yet implemented.  Smiley Sad


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 5

ekinsb
Alumni
Alumni
Accepted solution

By design, Apprentice is a subset of Inventor and has limited capabilities when compared to Inventor.  There are not any plans to keep adding functionality to Apprentice until it is equivalent to Inventor.  If there is a task that Apprentice doesn't support, the alternative is to use Inventor.  This may be bad news but I just want to set realistic expectations.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes