Community
Vault Forum
Welcome to Autodesk’s Vault Forums. Share your knowledge, ask questions, and explore popular Vault topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API Vault question

4 REPLIES 4
Reply
Message 1 of 5
Rene-J
331 Views, 4 Replies

API Vault question

Hi I am working on a addin for Inventor/vault

Is it possible to get Inventor Options.. Representation LOD from vault are this stored as vault property ?
If the Representation info isn't stored in vault ,is it possible to get the
location of of the selected file in the File Store

René J

4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Rene-J


Vault will extract the iProperties from the
Inventor file.  If 'representation' is not an iProperty, then Vault will
not get that information.

You can fix things by creating a custom iProperty
in the file prior to upload. 

If you are using Vault 2009, you will need to set
the property to 'In Use' after you upload the first file.  Once it's
activated, any other files uploaded with that property will get
extracted.

 

To find the current file in Vault, you need to
read the WorkingFolders.xml file.  It contains the mappings between the
local folders and the Vault folders. 


Or if unique file names is on, you can call
GetLatestFilePathsByNames from the API.

 

 

Doug Redmond

Software Engineer, Autodesk Inc.

 
Message 3 of 5
Rene-J
in reply to: Rene-J

Thanks Doug

I am using Inventor/Vault 2009
I know how to find the current file in vault.
I am using the Inventor project file instead of WorkingFolders.xml there are more info like
map folders libraries.
Representation LOD.. is not a iproperty.
I believe it was a info or property for this in the
vault, because if you select file from vault in Inventor
you have thes option see attach.

My code is working on my locale machine, but I am not
sure if this is right to do, or how to
get it to working on a server.


Dim files As DocumentSvc.File() = docSvc.GetFilesByMasterId(MasterID)
Dim file As DocumentSvc.File
Try
If (Not files Is Nothing AndAlso files.Length > 0) Then
file = docSvc.GetLatestFileByMasterId(MasterID)
files = Nothing
Else
MsgBox("Error - File Not found")
Exit Sub
End If

'Get the last file checked in to vault
Dim vfile As DocumentSvc.File = docSvc.GetFileByVersion(file.MasterId, file.MaxCkInVerNum)

Dim strFullFileName As String

{color:#ff0000}Dim strLocation_of_VaultFileStore As String = "C:\ProgramData\Autodesk\VaultServer\FileStore"
{color}
Dim vaultDatabase As String = VaultServiceManager.VDataBase
Dim strfiltype As String = Strings.Right(file.Name, 4)
Dim strmaps As String = "000\000\000\000\000\000"
Dim StrFilename As String = vfile.MasterId & "_" & vfile.Id & "_" & vfile.MaxCkInVerNum & strfiltype
'Get the physical Fullfilename in vaultFilestore
strFullFileName = strLocation_of_VaultFileStore & "\" & vaultDatabase & "\" & strmaps & "\" & vfile.MasterId & "\" & StrFilename
'strFullFileName = "C:\test\assembly.iam"

If System.IO.File.Exists(strFullFileName) = False Then
Exit Sub
End If

Dim oFileManager As FileManager
oFileManager = oApp.FileManager

Dim strGetDesignVRep() As String
strGetDesignVRep = oFileManager.GetDesignViewRepresentations(strFullFileName)

Dim strGetPosRep() As String
strGetPosRep = oFileManager.GetPositionalRepresentations(strFullFileName)

Dim strGetLODRep() As String
strGetLODRep = oFileManager.GetLevelOfDetailRepresentations(strFullFileName)


René J

Message 4 of 5
Anonymous
in reply to: Rene-J


First, do not access the server files
directly.  Leave the "000" folders alone!!!  If you want a file from
the server, call DownloadFile from the API.

 

Thanks for the screenshot, it makes things much
clearer.  I took a closer look at the Inventor plug-in, and here is how I
think it works.  It is not getting the information from Vault, it gets it
from the IAM file.  If the file does not exist locally, it calls
DownloadFile to retrieve it.

 

Also, I don't understand why you need to calls to
the three functions GetFilesByMasterId, GetLatestFileByMasterId, and
GetFileByVersion in a row.

After calling getFilesByMasterId, you have all
versions.  So you have all the information you need to find the latest
check-in version.  No need to make other API calls.

If you don't want to get all versions, then
GetLatestFileByMasterId is the call you want to make. 

face=Arial size=2>GetFileByVersion needs to be called next only if the file is
checked out.

 

 

Doug Redmond

Software Engineer, Autodesk
Inc.
Message 5 of 5
Rene-J
in reply to: Rene-J

Doug thanks
For you suggestions.
I have changed My program it work great now.
I don't know why I have calls the three functions GetFilesByMasterId...
Thanks for you help

René J

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

Post to forums  

Autodesk Design & Make Report