Import list of ipt in text file into iam?

Import list of ipt in text file into iam?

G60Dubs
Advocate Advocate
462 Views
5 Replies
Message 1 of 6

Import list of ipt in text file into iam?

G60Dubs
Advocate
Advocate

Hi

In the process of trying to correct file errors in order to check files into Vault (via Task Scheduler)

I have a list of files in a spreadhseet and at present I am opening one at a time, correcting the error and then checking in.    Is there a way to bulk import a list of ipt in say a text file, into an iam or another method of opening a txt list of files in Inventor?  This would save me hours of time having to CTRL c, CTRL v the file path into explorer for opening.

0 Likes
Accepted solutions (1)
463 Views
5 Replies
Replies (5)
Message 2 of 6

bradeneuropeArthur
Mentor
Mentor
Accepted solution

 

With this yes:

 

Dim a As AssemblyDocument = ThisAssembly.Document
Dim ac As AssemblyComponentDefinition = a.ComponentDefinition

For Each Line In System.IO.File.ReadLines("D:\_Tests\Load.txt")

MsgBox(Line)
Dim identity As Matrix
identity = ThisApplication.TransientGeometry.CreateMatrix

Dim aoc As ComponentOccurrence =  ac.Occurrences.Add(Line,identity)
Next

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 6

G60Dubs
Advocate
Advocate

Nice.   Is there any way to supress and skip unresolved files as these will error the code?

0 Likes
Message 4 of 6

G60Dubs
Advocate
Advocate

Not solved.   The proposed solution provides no benefit as any error in file resolution on file open or similar kicks the program out.    How would one suppress any and all errors during on each subsequent file open?

 

 

0 Likes
Message 5 of 6

bradeneuropeArthur
Mentor
Mentor

Try this:

 

Dim a As AssemblyDocument = ThisAssembly.Document
Dim inv As Inventor.Application= ThisApplication
Dim ac As AssemblyComponentDefinition = a.ComponentDefinition

inv.FileOptions.FileOpenOptions.SkipAllUnresolvedFilesInAssembly = True
inv.FileOptions.FileOpenOptions.SkipAllUnresolvedFilesInDrawing = True
inv.FileOptions.FileOpenOptions.SkipAllUnresolvedFilesInPart = True


For Each Line In System.IO.File.ReadLines("D:\_Tests\Load.txt")
	
MsgBox(Line)

Dim identity As Matrix
identity = ThisApplication.TransientGeometry.CreateMatrix

Dim aoc As ComponentOccurrence =  ac.Occurrences.Add(Line,identity)
Next

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 6 of 6

G60Dubs
Advocate
Advocate

Yeah that's definetely heading the right way.

 

Sorry for the delay in reply - Discovered my email was junkng everything from the autodesk domain. 

 

I do notice an issue where the 'FileOpenOptions.SkipAllUnresolvedFilesInPart' fails - Suppressed links with base components where the base component is unresolved.

 

Maybe one for a Dev to investigate?

0 Likes