Saving Imported Files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey
Looking for some pointers. I am importing files file from a step file. As they load into Inventor, a folder is automatically created called 'Imported Components' and all of the temporary files are loaded into it. This is not the destination location for the files, they need to be in another folder called Inventor/Components. I set up a method to traverse the assembly and save all of the components to the new location with a filepath using SaveAs(SavePath, False) and then replace the current occurrence in the assembly with the newly saved version. However its not working as expected.
I added a method to delete any files that may already exist in the destination folder first to prevent any issue that i had where it wouldnt overwrite an existing file.
The files appear to be saving but not replacing in the assembly. Furthermore, if my assembly has more than one occurrence it fails on the replace. I have tried oOcc.Replace(Savepath, False) & oOcc.Replace(Savepath, True) both of which throw an error. I trapped the error and the component doesnt replace.
Also worth noting, the Assembly is the last object to be saved
Does anyone have a working save method that would fit this instance?
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.