instead of this can i actually have it look at current project folder?
'these links will need to be updated for current physical location everytime folder is moved or renamed. Public Sub Main() If Component.IsActive("DETAIL B 26310C:1") Then ThisApplication.Documents.Open("G:\FEA\Baseline\shell outer _ 26310c rev - (Ilogic)\DETAIL B 26310C.iam", True) End If If Component.IsActive("DETAIL B 26310C REV1:1") Then ThisApplication.Documents.Open("G:\FEA\Baseline\shell outer _ 26310c rev - (Ilogic)\DETAIL B 26310C REV1.iam", True) End If If Component.IsActive("DETAIL B 26310C REV2:1") Then ThisApplication.Documents.Open("G:\FEA\Baseline\shell outer _ 26310c rev - (Ilogic)\DETAIL B 26310C REV2.iam", True) End If End Sub
Any help would help out alot.... thanks!
Solved! Go to Solution.
Solved by rjay75. Go to Solution.
Solved by mrattray. Go to Solution.
even this fails arghhhh
shell2 = Component.Visible(ThisDoc.FileName(False)) 'without extension) Component.InventorComponent(shell2).ExitEdit(kExitToPrevious)
Still it cant find the document (im running the rule inside the component im editing)
That won't work because you can't access a component occurrence while editing the component. It can only be accessed or referenced from the assembly.
Off hand don't know of a way to easily exit the editing document with out any references to the parent assembly.
Also the filename and the component names may look similar but they are two different names and don't match. So you can't use one to find another. If you want to use a consistent name, rename your components and use that name instead. Even if you change the underlying component document the component names stay the same.