Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Export ipt list

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
RodolfoZanni7664
497 Views, 3 Replies

Export ipt list

Hi,I'm a newbie.....

there is a way (vb.net or vba) to read a .iam file and save the complete list of the .ipt files in a .txt file.
Please,please, if possible attach a sample 🙂

 

Thank you

Rodolfo

 

 

3 REPLIES 3
Message 2 of 4

...solved !

thank you anyway
Message 3 of 4
jdkriek
in reply to: RodolfoZanni7664

Glad you found something, thought I would post my script anyway incase someone else needed it

 

' JDK 2013
' If this is Assy Doc
If ThisDoc.Document.DocumentType = 12291 Then 
	' Define txt doc name
	Dim sPath As String = "C:\test.txt"
	Dim oAssDoc As AssemblyDocument = ThisApplication.ActiveDocument
	Dim oAssDef As AssemblyComponentDefinition = oAssDoc.ComponentDefinition
	Dim oOccurrence As ComponentOccurrence
	Dim i As Integer
	' If txt doc exists
	If System.IO.File.Exists(sPath) = True Then 
		' Open stream to txt doc
		Dim objWriter As New System.IO.StreamWriter(sPath)
			' Look at each occurrence in Assy
			For Each oOccurrence In oAssDef.Occurrences
				'If it's a part file
				If TypeOf oOccurrence.Definition Is PartComponentDefinition Then
					i = i + 1
					sName = Split(oOccurrence.Name, ":")
					' Write occurrence name to txt doc
					objWriter.Write("Part " & i & ": " & sName(0) & vbNewLine)
				End If
			Next
		' Close txt doc
		objWriter.Close()
		MsgBox("List Written to File")
	Else
		MsgBox("File Does Not Exist")
	End If
End If
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


Message 4 of 4
RodolfoZanni7664
in reply to: jdkriek

Thank you for your replay, you are very kind.
Fortunately, I found how to do.

Best regards
Rodolfo

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report