- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an assembly the contains one part, and a drawing that contains one view of that assembly and one view of that part.
I have an iLogic rule in the part and basically the same rule in the assembly, that will do a "Save As" on the part to create a new file.
When I do this from the part, somehow the part is replaced in the open assembly and the open drawing, even though the rule in the part is not looking at anything other than the part file document.
When I do this from the assembly, I expect it to update the part in the assembly. But it actually replaces the part file in the drawing view with the new part file also, even though the iLogic is not looking at the drawing.
So it appears the the Save As magically replaces the old file with the new file in all open documents that reference it.
I've attached a simple data set here. The files are Inventor 2015 files.
Questions:
Why does this happen?
And is there a way to prevent this?
Thanks in advance,
Curtis
The code is pretty basic, for the part rule it is this:
NewFileName = "Cube_ " & TimeString 'add prefix NewFileName = Replace(NewFileName,":", ".") 'remove colons, replace with periods 'do save as ThisDoc.Document.saveas(ThisDoc.Path & "\" & NewFileName & ".ipt" ,False) MessageBox.Show("New File: " & ThisDoc.Path & "\" & NewFileName & ".ipt", "iLogic")
For the assembly it is this:
Dim refDoc As Document For Each refDoc in ThisDoc.Document.AllReferencedDocuments NewFileName = "Cube_ " & TimeString 'add prefix NewFileName = Replace(NewFileName,":", ".") 'remove colons, replace with periods 'do save as refDoc.saveas(ThisDoc.Path & "\" & NewFileName & ".ipt" ,False) MessageBox.Show("New File: " & ThisDoc.Path & "\" & NewFileName & ".ipt", "iLogic") Next
Solved! Go to Solution.