Message 1 of 4

Not applicable
08-01-2016
12:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Community,
I wrote a rule wich export my drawing do a dxf.
The rule worked perfect, until we updated to Inventor 2017.
The rule switches off/on the drawing views, depending if they exist in the assembly-this works fine.
Can you tell me whats wrong?
I can see, in the comand line, that an export happens, but i can t find the file, i searched my hole harddrive for it.
??? may a version problem?
Thanks for help,
Code attatched
Simon
SyntaxEditor Code Snippet
ActiveSheet = ThisDrawing.Sheet("Laserlayout_SELM_Sample:2") ActiveSheet.View("ANSICHT12").View.Suppressed = True ActiveSheet.View("ANSICHT11").View.Suppressed = False ActiveSheet.View("ANSICHT13").View.Suppressed = False ActiveSheet.View("ANSICHT14").View.Suppressed = False ActiveSheet.View("ANSICHT65").View.Suppressed = False ActiveSheet.View("ANSICHT66").View.Suppressed = False ActiveSheet.View("ANSICHT67").View.Suppressed = False question = MessageBox.Show("Willsch a DXF f�r da Laser speichra? Momentan ischas: "& Parameter("Teileraum.iam.SETM")& " mm" & vbCr & "Wenn alls richtig isch drucksch jo sus na", "iLogic Question",MessageBoxButtons.YesNo,MessageBoxIcon.Question) 'set condition based on answer If question = vbYes Then 'gather input from user, uses current parameter as input default ' Get the DXF translator Add-In. 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 ' Check whether the translator has 'SaveCopyAs' options If DXFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then Dim strIniFile As String strIniFile = "C:\temp\dxfout.ini" ' Create the name-value that specifies the ini file to use. oOptions.Value("Export_Acad_IniFile") = strIniFile End If 'Set the destination file name oDataMedium.FileName =ActiveSheet.Name &"_"& Parameter("Teileraum.iam.SELM")&"mm"&".dxf" 'Publish document. DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 'Launch the dxf file in whatever application Windows is set to open this document type with'i = MessageBox.Show("Preview the DXF file?", "Title",MessageBoxButtons.YesNo,MessageBoxIcon.Question)'If i = vbYes Then ThisDoc.Launch(oDataMedium.FileName) 'oDataMedium.FileName = ThisDoc.PathAndFileName(False) & ".dxf" Else If question = vbNo Then 'set parameter back to its original value Length = tempLength 'confirm action MessageBox.Show("denn halt net") End If
Solved! Go to Solution.