Message 1 of 11
iLogic : Export idw part data to text file

Not applicable
08-07-2013
07:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We have an idw package we use for Quality control. This idw has more than one sheet. Each sheet has a part placed on the sheet with dims.( DWF attached). Next we open DA inside of the file and run a report. (exported txt attached). I am trying to use ilogic the make the same report with a iLogic browser button pick. I have 2 codes (code examples on attached jpg) that i need to make into 1, or what ever works. Any help would be great.
Having trouble attaching the DWF so it is not attached
1st code
Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument Dim oSubDoc As Inventor.Document Dim oPropSets As PropertySets Dim oPropSet As PropertySet Dim oPartNumiProp As Inventor.Property For Each oSubDoc In oDoc.AllReferencedDocuments If oSubDoc.documenttype = kpartdocumentobject Then oPropSets = oSubDoc.PropertySets oPropSet = oPropSets.Item("Inventor User Defined Properties") oPartNumiProp = oPropSet.Item("PCMK") sMsg=sMsg & oSubDoc.FullFileName & vbLf End If Next MessageBox.Show(sMsg, "PCMK")
2nd code
fileheader = "QAF Parts for Planning " fileheader1 = ThisDoc.PathAndFileName(True) 'first line header of txt file description = "Components to use for Nesting" 'use this variable in the body of the txt delimiter = "," 'character to separate the names and values on each line oWrite = System.IO.File.CreateText(ThisDoc.PathAndFileName(False) & ".txt") oWrite.WriteLine(fileheader) 'include the fileheader on the first line oWrite.WriteLine(fileheader1) 'include the fileheader on the first line oWrite.WriteLine(description) 'include the description on the second line oWrite.WriteLine(Now()) 'include the current date and time on the third line oWrite.WriteLine() 'blank line oWrite.Close() 'option to view report go = MessageBox.Show("Would you like to view the txt file?", "QAF Nesting Report", MessageBoxButtons.YesNo) If go = 6 Then ThisDoc.Launch(ThisDoc.PathAndFileName(False) & ".txt")