Apprentice: Replace components with different internal name

Apprentice: Replace components with different internal name

IQUADRATAG
Contributor Contributor
864 Views
5 Replies
Message 1 of 6

Apprentice: Replace components with different internal name

IQUADRATAG
Contributor
Contributor


Hello,

I would like to know if there is any possibility to replace a component with another one, that has a different internal name. Losing the dependencies would be acceptable.

 

ReplaceReference and PutLogicalFileNameUsingFull always return the error "wrong parameter".

 

Thank you in advance

Christian

0 Likes
865 Views
5 Replies
Replies (5)
Message 2 of 6

philippe.leefsma
Alumni
Alumni

Hi Christian,

 

Which release version are you using? The ability to replace references that have a different internal name was added in Inventor 2011, I would think it is the same for Apprentice.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 6

IQUADRATAG
Contributor
Contributor

Hi Philippe,

 

thank you for your answer. I'm using version 2013 (64 Bit). Replacing the reference only works direclty in Inventor, but neither using the Inventor-API nor using Apprentice.

 

Perhaps you can tell me which function I should use?

 

Regards,

Christian

0 Likes
Message 4 of 6

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

I am not sure how you wrote by Apprentice, but this is a blog which may help you:

 

http://adndevblog.typepad.com/manufacturing/2012/08/replace-the-file-reference-by-inventor-api.html

0 Likes
Message 5 of 6

IQUADRATAG
Contributor
Contributor

Hi,

 

I'm using the method "ReferencedFileDescriptor.replaceReference", as shown in the mentioned blog. it works perfectly, but only for files that share the same internal name.

 

Regards,

Christian

0 Likes
Message 6 of 6

philippe.leefsma
Alumni
Alumni

Hi Christian,

 

I doubt files with different ancestry can be replaced after all, wether you use Inventor or Apprentice. Comments from the ReplaceReference method in Help Files confirm this:

 

The file being replaced and the replacement file must share ancestry (i.e. they must have the same InternalName). Documents have the same internal name if they are copied using 'Save Copy As' or a file explorer copy.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes