Replace a part in multiple assemblies

Replace a part in multiple assemblies

Anonymous
Not applicable
3,130 Views
13 Replies
Message 1 of 14

Replace a part in multiple assemblies

Anonymous
Not applicable

Hello,

 

I have always worked with Solidworks, but 6 months ago our company switched to Inventor.

Everything is going well, but there is one thing i cant get done.

 

I have a lot of parts that occur in multiple assemblies. 

Sometime i want to replace a part for another part (look al like) in all the assemblies.

For example: a plate with 4 holes replace for the same plate with 5 holes.

 

In Solidworks you can use the Solidworks Explorer, and replace the part for the other part and it is applied in all the assemblies.

But in Inventor you only replace the part in 1 assembly, so you have to replace them all by yourself. (with design assistent or in the assembly by replace component).

 

My question:

Is it possible to replace a part in all of the assemblies?

 

Hope you can help me.

 

Gerwin.

 

 

 

0 Likes
Accepted solutions (1)
3,131 Views
13 Replies
Replies (13)
Message 2 of 14

SharkDesign
Mentor
Mentor

I think it can be done in vault, but would need to check. Do you have vault?

 

 

  Inventor Certified Professional
0 Likes
Message 3 of 14

SharkDesign
Mentor
Mentor

You can definitely do it with iLogic and the code wouldn't be too hard. 

 

  Inventor Certified Professional
0 Likes
Message 4 of 14

Anonymous
Not applicable

No we don't have Vault.

0 Likes
Message 5 of 14

Gabriel_Watson
Mentor
Mentor
We typically leverage operations like that using Vault Professional's "Copy Design" tool, and "Replace":
https://knowledge.autodesk.com/support/vault-products/learn-explore/caas/CloudHelp/cloudhelp/2021/EN...
0 Likes
Message 6 of 14

SharkDesign
Mentor
Mentor

I can write some code a bit later, just going to the supermarket now. 

 

  Inventor Certified Professional
0 Likes
Message 7 of 14

Anonymous
Not applicable

haha thats okay

0 Likes
Message 8 of 14

johnsonshiue
Community Manager
Community Manager

Hi! This can be done within Inventor via Replace Component workflow. Or, use the standalone Design Assistant. Right-click on the assembly in File Explorer -> Design Assistant -> Manage -> select the part -> Action = Replace -> select the new part.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 9 of 14

Anonymous
Not applicable

I know,  but i want to replace the part in all assemblies where the part occurs.

0 Likes
Message 10 of 14

SharkDesign
Mentor
Mentor
Accepted solution

This won't go through your entire hard drive, just the sub assemblies within the one you have open. 

Also, I'm not an iLogic expert and I've only very basically tested this so try it on something you don't mind making a mess of, or at least do an iLogic design Copy on an assembly first to try it out.

 

You just need to copy and paste the code into a new rule in your iLogic pallet.

 

Then change these two lines. The first is just the file name of the part you want to remove, the second is the full path and file name of the part you want to put in. N.B. your new part, you say has a different number of holes, you have to have modelled this from the old part and changed the number of holes or your constraints are going to break.

 

These are the lines you need to change:

jameswillo_0-1636145023241.png

 

 

Good luck!!!

 


Class
this rule Dim oOld As String = "xxx.ipt" 'Replace xxxxxx with the file name of part to replace Dim oNew As String = "C:\xxxxxxx.ipt" 'replace xxx with full path, name and .ipt on the end of the file you want to use instead Dim oOcname As String Sub Main If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject Then MessageBox.Show("This rule is designed to only work in assembly documents.", "Wrong Document Type") : Exit Sub Dim parentDoc As AssemblyDocument = ThisApplication.ActiveDocument 'Do anything unique to main assembly Call AssemblyRunner(parentDoc) End Sub Sub AssemblyRunner(aDoc As AssemblyDocument) 'Do things to the assembly file if any 'MessageBox.Show(aDoc.DisplayName, "Assembly:") 'Start Looping For Each oOcc As ComponentOccurrence In aDoc.ComponentDefinition.Occurrences If oOcc.DefinitionDocumentType = kAssemblyDocumentObject Call AssemblyRunner(oOcc.Definition.Document) Else If oOcc.DefinitionDocumentType = kPartDocumentObject oOcname = oOcc.Name Call PartRunner(oOcc.Definition.Document, aDoc) End If Next End Sub Sub PartRunner(pDoc As PartDocument, parent As AssemblyDocument) If pDoc.DisplayName = oOld Component.Replace(oOcname, oNew, True) End If End Sub End Class
'loop code borrowed from JCamper

 

 

  Inventor Certified Professional
Message 11 of 14

swalton
Mentor
Mentor

That Solidworks tool sounds useful.  I am not aware of a direct equivalent in Inventor.

 

I'd try the following:

  1. Make a temporary container assembly and name it George.iam.
  2. Place a copy of each assembly you plan to modify in George.iam.
  3. Save George.

At this point I'd have two choices.  I could use the Replace All command in George.iam to replace all the parts at once, or run Design Assistant on George to replace every instance.  I'm not sure that Replace All penetrates into sub-assemblies.  Testing is required.

 

I'm not aware of a workflow in Vault that lets me replace plate1.ipt with plate2.ipt in every assembly that uses plate1.ipt.

Steve Walton
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Inventor 2025
Vault Professional 2025
Message 12 of 14

Anonymous
Not applicable

Good morning,

 

I tried this.

This works only in de assembly you have open, but i think it should be like this.

Or do i have to run this rule every time before open an assembly?

 

I can search in design assistant wich assembly uses my part, and then open all the assemblies and run in every assembly the rule. But that's still a lot of work.

Is it possible with ilogic, to make a rule who search in all the assemblies without open te concerned assembly?

 

thanks in advance.

0 Likes
Message 13 of 14

SharkDesign
Mentor
Mentor
You can create a blank assembly, drop a load of assemblies in it and let it
run. Then just save afterwards.
You cave it in external rules and then have it run every time you open an
assembly but this is a bit dangerous and also would take ages to open an
assembly.


  Inventor Certified Professional
Message 14 of 14

Anonymous
Not applicable

Thank you james.

I think the best way for me is, search in Desgin assistant wich assembly uses the part.

Then run the rule with event trigger after open all of the assemblies.

Save.

And then delete the rule.

 

I can work with it, thanks.

 

 

0 Likes