Issue with iPart/iAssembly Member File Generation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I seem to have entered the 7th Circle of Hell.
I have been using some iLogic code to generate all member files of an iPart or iAssembly.
I run the code, the parts are generated & I'm not prompted to save the ipart or iAssembly file when done.
However on a seemingly random basis, if I add the iPart of iAssembly to another assembly, I'm prompted to save the instance. If I do, I'm then prompted to update the original iPart or iAssembly when I open that file, which of course then requires a save.
Then if I open any file which references said iPart or iAssembly, I'm required to update & save.
And around we go again.
If however I generate the member files by selecting them from the tree & manually selecting "generate files", the issue does not present. But that requires user intervention for every member file & is more time consuming.
The code I'm using is from THIS THREAD), shown below:
ThisDoc.Document.Rebuild() InventorVb.DocumentUpdate() 'If it Is an iPart If ThisDoc.Document.DocumentType = kPartDocumentObject Then Dim oDoc As PartDocument = ThisDoc.Document Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition Dim oFactory As iPartFactory = oDef.iPartFactory Dim oRow As iPartTableRow For Each oRow In oFactory.TableRows oFactory.CreateMember(oRow) Next End If 'If it is an iAssembly If ThisDoc.Document.DocumentType = kAssemblyDocumentObject Then Dim oDoc As AssemblyDocument = ThisDoc.Document Dim oDef As AssemblyComponentDefinition = oDoc.ComponentDefinition Dim oFactory As iAssemblyFactory = oDef.iAssemblyFactory Dim oRow As iAssemblyTableRow For Each oRow In oFactory.TableRows oFactory.CreateMember(oRow) Next End If iLogicVb.UpdateWhenDone = True
If there something wrong with it, it's not obvious to me.
Can anyone shed any light on it?