• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups
    11 Kudos
    japike

    Replace Component for Derived Parts

    Status: Solution Provided
    by Valued Mentor on ‎12-04-2012 07:07 AM

    Add an option in parts created from derived components to replace the derived component.

    Status: Solution Provided
    Curtis' solution works but we already are considering building it in. [US4564 ] Another workaroudn solution is to rename the file you derived FROM and open the derived part. When you get the resolve file dialog pick the one you want to replace the original source with.
    Comments
    by *Expert Elite* ‎12-12-2012 07:50 AM - edited ‎12-12-2012 08:08 AM

    This is a good suggestion, I do this now with an iLogic rule, but it would be nice to have it built in.

     

     
    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

     

    by Valued Mentor on ‎12-13-2012 06:41 AM
    Wow!! That works great. Thanks Curtis.
    by Employee steven.dennis on ‎01-29-2013 01:20 PM
    Status changed to: Solution Provided
    Curtis' solution works but we already are considering building it in. [US4564 ] Another workaroudn solution is to rename the file you derived FROM and open the derived part. When you get the resolve file dialog pick the one you want to replace the original source with.
    by *Expert Elite* on ‎04-03-2013 11:09 AM

    Workarounds are not a solution. I just came here looking to post this same idea.

    Just like this one: http://forums.autodesk.com/t5/Autodesk-Inventor/Derived-Part-Replace-Model-Reference/m-p/3062998#M40...

    Announcements
    IdeaStation Guidelines
    Review guidelines and best practices
    before posting a new idea.