Converting LOTS of STEP files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using Inventor 2014, and I'm working with a FIRST FRC Robotics team. We'd like to convert the STEP files we get from vendors into Inventor files so we can use them more easily to create the design of our robot. The problem is, there are several thousand parts, so doing it by hand, while possible, would take too much time for the number of students we have.
I've written a script that renames the parts files, including the internal references, to match our part numbering system, but now I need to do the actual conversion. The simplest way appears to be to open each part in Inventor, which then creates a .ipt file in the project, and then close the part - rinse repeat. It seems like the perfect job for some kind of scripting or macro language. Inventor uses VBA, which I haven't touched for years, but I'm working on picking it back up.
I've done a lot of searching, but haven't found anything that works. Can someone please help me?
Thanks,
Ray
Below is my test routine. In it, I'm just trying to open a STEP file in Inventor. The part filename comes from the filenames.txt file.
Sub ProcessDoc()
' Open filename file
Dim File_Path As String
File_Path = "C:\Users\Ray\Desktop\Unzipped Parts\filenames.txt"
MsgBox "Trying to open " + File_Path
Dim fs, f, ts, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(File_Path)
Set ts = f.OpenAsTextStream(1, -2)
s = ts.ReadLine
MsgBox s
Set oInv = ThisApplication.Documents.Open(s)
ts.Close
End Sub