Create DXF from Selected Drawing Views?

Create DXF from Selected Drawing Views?

Anonymous
Not applicable
243 Views
0 Replies
Message 1 of 1

Create DXF from Selected Drawing Views?

Anonymous
Not applicable

Greetings,

 

I came across a code (see below) to export an inventor drawing to a DXF file, and it works great for what it is, but I was wondering if it's at all possible to take this code (or if there's another code that works better) and apply it to individual drawing views? 

 

Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 12316 StartFragment: 314 EndFragment: 12284 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet

'query user
question = MessageBox.Show("is a .DXF Export Required", "iLogic Question",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
'set condition based on answer
If question = vbYes Then
' Get the DXF translator Add-In.
path_and_nameDXF = ThisDoc.PathAndFileName(False)
Dim DXFAddIn As TranslatorAddIn
DXFAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}")
'Set a reference to the active document (the document to be published).
Dim oDocument As Document
oDocument = ThisApplication.ActiveDocument
Dim oContext As TranslationContext
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
' Create a NameValueMap object
Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
' Create a DataMedium object
Dim oDataMedium As DataMedium
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
If DXFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
Dim strIniFile As String
strIniFile = "W:\ENG34_TED\Inventor Research\Invengers Research"
oOptions.Value("Export_Acad_IniFile") = strIniFile
End If
oDataMedium.FileName = path_and_nameDXF & ".dxf"
Call DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
End If 

 

0 Likes
244 Views
0 Replies
Replies (0)