Hi,
is there a iLogic rule to open a part froma the assembly browser?
I tried this code but it doesent work 😞
compo = Component.InventorComponent("Obere Rahmen:1")
compo.Open
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Solved by MechMachineMan. Go to Solution.
So helpful... Maybe you're doing the small amount of work for them (if you know API and iLogic, this would take you less than 5 minutes), but you're helping countless people years later dealing with the same issue. These few lines you could've posted would have been great help to further learn this coding, as most of us will learn by trial and error.
1. Do you think I was magically born with all of this knowledge, or did I perhaps go through the same struggles of trial and error with this?
2. You're not entitled to anyone's help. Maybe reconsider your perspective. Would helping people be the "nice" thing to do? Yes. Is helping people a requirement/owed to people? No.
3. Read and learn. It's a sloppy mix of iLogic and vb.net, but it works.
Sub Main() OpenDocByBrowserName("PartB:1") End Sub Sub OpenDocByBrowserName(oBrowserName) Dim compOcc As Inventor.ComponentOccurrence Try compOcc = Component.InventorComponent(oBrowserName) Catch MsgBox("Issue finding browser name." & vbLf & vbLf & Chr(34) & oBrowserName & Chr(34)) Exit Sub End Try Dim oDoc As Inventor.Document oDoc = compOcc.Definition.Document oDocName = oDoc.FullDocumentName Try ThisApplication.Documents.Open(oDocName, True) Catch MsgBox("File has not been saved or other issue opening file occurred" & vbLf & vbLf & Chr(34) & oBrowserName & Chr(34)) Exit Sub End Try End Sub
These few lines you posted has been great help to further learn this coding, as I mostly learn by trial and error. Thank you.
Hi everyone,
here is another example for doing this, that I use...
oOcc = "PartA:1" Try ThisDoc.Launch(Component.InventorComponent(oOcc).Definition.Document.FullFileName) Catch End Try
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Can't find what you're looking for? Ask the community or share your knowledge.