Changing the IPart file with referencing drawing using API gets a warning when I tried to open the drawing.

Changing the IPart file with referencing drawing using API gets a warning when I tried to open the drawing.

jmacapagal2CD9H
Contributor Contributor
260 Views
3 Replies
Message 1 of 4

Changing the IPart file with referencing drawing using API gets a warning when I tried to open the drawing.

jmacapagal2CD9H
Contributor
Contributor

I have 2 IPart (XTR-P2-001, XTR-P2-002 ), The XTR-P2-002 is referencing by drawing. I created a copy of the 2 IPart to a new folder and update the iPartFactory.TableRows based on the copied IPart name using the code below

 

Dim iPartMemberDocument As Inventor.PartDocument = invDocument
Dim iPartMember As Inventor.iPartMember = iPartMemberDocument.ComponentDefinition.iPartMember
Dim Row As Integer = iPartMember.Row.Index

Dim iPartFactory As Inventor.iPartFactory = iPartMember.ParentFactory
Dim ColumnCount As Integer = iPartFactory.TableColumns.Count

For Column As Integer = 1 To ColumnCount
Dim OriginalValue As String = iPartFactory.TableRows(Row)(Column).Value
iPartFactory.TableRows(Row)(Column).Value = OriginalValue.Replace("XTR-P2-002", "00002586-02")
Next

 

Now, I updated my iPart ReferencingFiles to start using the Copied IPart including the drawing. If I try to open the drawing and gets this warning

jmacapagal2CD9H_0-1649140717353.png

 

jmacapagal2CD9H_1-1649141112023.png

 

Is there a way to fix this without generating a new Ipart using API?

Thank you.

 

0 Likes
261 Views
3 Replies
Replies (3)
Message 2 of 4

Ralf_Krieg
Advisor
Advisor

Hello

 

The drawing references the old (not longer a member) iPart file. You can user the Replace Reference function to cheange the reference the drawing looks at.

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2014... 


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 4

jmacapagal2CD9H
Contributor
Contributor

Thanks @Ralf_Krieg, but is there a way to do this using Inventor API?

0 Likes
Message 4 of 4

Ralf_Krieg
Advisor
Advisor

Hello

 

I think it could be done with the FileDescriptor.ReplaceReference method.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes