- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Running a script on parts in assembly
Trying to solve a problem, not sure it is possible tho.
I have a script that works well, and does what it's suppose to do.
But in order for it to work I need to open up each part and run it, which is rather taxing.
I would like to be able to select part in the model tree in the assembly and run my script, I know how to make a script to go through each part in the assembly and run it, but it wont work in this case, as I might only want to run it on say 30 out of 70 parts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @jonatan.holmgren ,
Try something like this example, which sets the part number of each selected occurrence to be 777, note that this example might error out if a browser node that was not an occurence was selected, such as an assembly level work plane, etc.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition Dim oSelection As SelectSet oSelection = ThisApplication.ActiveDocument.SelectSet Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oSelection iProperties.Value(oOccurrence.Name, "Project", "Part Number") = "777" Next