Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RefId

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
FRFR1426
713 Views, 5 Replies

RefId

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?

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
5 REPLIES 5
Message 2 of 6
FRFR1426
in reply to: FRFR1426

Ok, I've made some progress. OldPaths and Indices comes from the undocumented method _GetReferenceInfo of ApprenticeServerDocument.

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
Message 3 of 6

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 !

Message 4 of 6

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.

 

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
Message 5 of 6

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 !

Message 6 of 6
Tobias.28
in reply to: FRFR1426

Is there a way to retrieve this information by the inventor application API?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report