Changing the Base Component in a Derived Part

Changing the Base Component in a Derived Part

rknaack
Participant Participant
5,968 Views
6 Replies
Message 1 of 7

Changing the Base Component in a Derived Part

rknaack
Participant
Participant

I am working with a derived part in Autodesk Inventor Professional 2018 and I want to change the name of the base component.  I have not found a way to substitute or directly change the name of the base component.  Does anyone know a way to do this.  The change I'm making to the base component will make the name incorrect and misleading if it is left unchanged.

0 Likes
Accepted solutions (2)
5,969 Views
6 Replies
Replies (6)
Message 2 of 7

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

Hi, if you want to change the name of the base component in derived part you can do it, you could simply close the file and then change the name of the base component, and when you reopen the file with the base component, it will not find the reference of the base component and inventor will ask you to specify the new file path, then you will select the base component that you have renamed and the new name will be updated in your references.
You can do the same with Design Assistant by changing the name of the base component.

You could also come up with a solution through programming.
Now, if you want to change the base component to a totally different part, I think you can't do it, because they have different IDs. Here I leave you a very well explained thread about the subject in question.

https://forums.autodesk.com/t5/inventor-forum/change-path-location-of-derive-part/td-p/7529364

I hope this helps with your problem. Regards


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 3 of 7

pball
Mentor
Mentor

If this is something you do often, it is possible to write a simple vba or ilogic script to simplify replacing the base component. If you're interested I can dig up the code I have for doing this.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
Message 4 of 7

rknaack
Participant
Participant

Thank you for the very helpful reply.

0 Likes
Message 5 of 7

rhasell
Advisor
Advisor
Accepted solution

Hi

 

I got this many years ago from Curtis.  As @Sergio.D.Suárez mentioned, it will not work with a completely different part.

 

  Dim oDoc as Document
oDoc = ThisDoc.Document
Dim oRefFile As FileDescriptor
Dim oOrigRefName As Object     

For Each oRefFile In oDoc.file.ReferencedFileDescriptors
'get the full file path to the original internal references
oOrigRefName = oRefFile.FullFileName

'present a File Selection dialog
Dim oFileDlg As inventor.FileDialog = Nothing
InventorVb.Application.CreateFileDialog(oFileDlg)
oFileDlg.InitialDirectory = oOrigRefName
oFileDlg.CancelError = True
On Error Resume Next
oFileDlg.ShowOpen()
If Err.Number <> 0 Then
Return
ElseIf oFileDlg.FileName <> "" Then
selectedfile = oFileDlg.FileName
End If

'replace the reference
oRefFile.ReplaceReference (selectedfile)     
InventorVb.DocumentUpdate()
oOrigRefName = ""                                        
Next

iLogicVb.UpdateWhenDone = True
Reg
2026.1
Message 6 of 7

IgorMir
Mentor
Mentor

You can do it in the Design Assistant. There is no need for a special code or any other intricacies.

Cheers,

Igor.

 


@rknaack wrote:

I am working with a derived part in Autodesk Inventor Professional 2018 and I want to change the name of the base component.  I have not found a way to substitute or directly change the name of the base component.  Does anyone know a way to do this.  The change I'm making to the base component will make the name incorrect and misleading if it is left unchanged


 

Web: www.meqc.com.au
Message 7 of 7

jef.clissen
Contributor
Contributor

Thanks for this!

 

I'm going to implement this into a nice form so it's accessible for our engineers.

This should honestly be inside the right-click menu of the derived part feature: "replace base component".

But I understand that this can cause a lot of errors...