I need to add IAM and IDW to Vault with FileManager.AddFile but I don't know how to compute the RefId member of the FileAssocParam class like Inventor does. It doesn't not seem to be sequential. I've an IDW file referencing one assembly and the RefId is set to "6" when I add it to Vault. On other assemblies, it is set to "1". How does it work?
There is some info on the CoolOrange web site (http://blog.coolorange.com/2013/07/15/updating-references-with-vault-2014-api/, in the comments) but I don't understand this sentence:
> Finally we realized that the Index array and the OldPath array goes hand in hand, so first OldPath/Reference has first Index, and so on.
What is the Index and the OldPath array? This must be on the Inventor side I think, but where?
Solved! Go to Solution.
Solved by bradeneuropeArthur. Go to Solution.
Solved by FRFR1426. Go to Solution.
Ok, I've made some progress. OldPaths and Indices comes from the undocumented method _GetReferenceInfo of ApprenticeServerDocument.
Hi @FRFR1426
Did you find anything else about the meaning of the Refid? Seems that you can also filter with it. But I did not find any sequence in it.
Regards,
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
You need to open your assembly with ApprenticeServer. Then you call _GetReferenceInfo() on your document:
var server = new ApprenticeServerComponent();
ApprenticeServerDocument document = server.Open("C:\Temp\Foo.iam");
document._GetReferenceInfo(out string _, out string _, out object indices, out object _,
out object currentPaths);
You will get two arrays with the same size: indices and currentPaths.
For example:
object currentPaths = { "C:\Temp\A.ipt", "C:\Temp\B.ipt" }; object indices = { 7, 3 };
You can match the two: A.ipt has refId = 7 and B.ipt has refId = 3.
I use this
For Each el In oFileAssocArraylite(0).FileAssocs el.RefId next
But I don't see what this actually means...
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !