Message 1 of 2
iLogic "Export face as" in DXF version 2000
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi.
I want to make sure output version of DXF is version 2000. Even if I change it manually, version always go to 2018 when using the macro I developed.
Please note that I don't want to export flat pattern. I want to export any selected face. I believe I cannot use DataIO, as it will only export flat pattern instead of any selected face.
Any idea on how I can make sure to export DXF 2000 version?
I am using Inventor Professional 2019 on a Windows 10 64 bits machine.
Thanks.
'check that this active document is a part file
Imports System.Windows.Forms
If ThisApplication.ActiveDocument.DocumentType <> kPartDocumentObject Then MessageBox.Show("Apenas pode gravar um DXF em ficheiros *.ipt", "Erro!") Return End If revision = (iProperties.Value("Project", "Revision Number")) ofolder = ThisDoc.Path & "\PDF Automaticos\" If ThisApplication.GeneralOptions.UserName = "AMC" Then 'ofolder = ofolder & "\AMC\" End If FileExists = True FileName = ofolder & (iProperties.Value("Project", "Part Number")) & "_" & revision & ".dxf" Do While FileExists SaveAs = MessageBox.Show("Exportar face para o ficheiro '" & FileName & "'?", "Exportar DXF", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) If Dir(FileName) <> "" Then My.Computer.FileSystem.DeleteFile(FileName) FileExists = True End If If SaveAs = vbNo Then Return Else ' User says continue FileExists = False End If Loop ThisApplication.ActiveView.Fit 'Criar Flat Pattern (se não existir), e alternar para Flat Pattern If ThisApplication.ActiveDocument.ComponentDefinition.Type = 150995200 ThisApplication.ActiveDocument.ComponentDefinition.Unfold() ThisApplication.ActiveDocument.ComponentDefinition.FlatPattern.Edit() End If Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument 'add filename to memory for file save dialog Dim Cm As CommandManager Cm = ThisApplication.CommandManager Cm.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent, FileName ) Dim oSelectSet As Selectset oSelectSet = oDoc.SelectSet oDoc.SelectSet.Clear() If Not System.IO.Directory.Exists(oFolder) Then System.IO.Directory.CreateDirectory(oFolder) End If 'SELECTION CODE Dim oFace As Face oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Seleccione uma face") If (oFace Is Nothing) Then Return Else Call oDoc.SelectSet.Select(oFace) End If ' EXPORT CODE 1 Dim oCtrlDef As ButtonDefinition oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("GeomToDXFCommand") Call oCtrlDef.Execute 'CLEAR selectset oDoc.SelectSet.Clear() If ThisApplication.ActiveDocument.ComponentDefinition.Type = 150995200 ThisApplication.ActiveDocument.ComponentDefinition.FlatPattern.ExitEdit() End If