How does Inventor keep track of occurrence numbers for duplicate parts? Can I access this functionality with iLogic?
I have an assembly where I add several parts by iLogic. I assign a name to each new part, but also have to name parts that are duplicates. Each duplicate needs a unique occurrence number. I know when I place a component duplicate using the "Place Component" command Inventor automatically iterates the occurrence number. Is there a way to access this ability using iLogic? I want to write a rule that will ensure that component duplicates will always have unique occurrence numbers without having to check every occurrence in the assembly each time.
I am able to write rules that can check each component and can iterate the number, but I'd like to use any built in functionality Inventor already has if possible.
Solved! Go to Solution.
Solved by gcoombridge. Go to Solution.
Leave the occurrence name field in the add component snippet blank with "" and it will automatically choose the next number
Dim componentA = Components.Add("", "Spring.ipt", position := Nothing, grounded := False, visible := True, appearance := Nothing)
Hi @myronHBBUW
You can use the occurrence object to identify the occurrence and then reference its name in the constraints. Add the constraints by first manually constraining then using capture snippet to record the constraints through code. Then you can adjust/copy for your occurrence. If you also leave the constraint names blank also they will be sequenced automtically.
Dim occName as String = componentA.Name
If your still having trouble please post the code your using with the questions you have in a new post. It will gain more views and will be solved quicker than working in a solved post.
Can't find what you're looking for? Ask the community or share your knowledge.