Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CheckIn and CheckOut Using inventor API/Commands

11 REPLIES 11
Reply
Message 1 of 12
santoshr0114
4325 Views, 11 Replies

CheckIn and CheckOut Using inventor API/Commands

Dear All,

 

I need to checkout and checkin files(iam/ipt/idw) along with references in inventor.

 

I have tried using the Vault API to checkOut and checkIn but the references are lost and its not getting checkout to the working folder by default.

 

How can i get this done using inventor using comething like this below

m_inventorApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(True)

 

My current plan.

Step 1: CheckOut files to its working folder (Not achieved using Inventor API)

Step 2: open the file in Inventor (Can be done using Inventor API)

Step 3; CheckIn the opened file (Can be done using m_inventorApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute2(True))

 

Any help/ideas

 

Regards

Regards
Santosh
11 REPLIES 11
Message 2 of 12

Could you please look at this blog article published by Wayne Brill:

Checkout & CheckIn a file in Vault 2014

http://adndevblog.typepad.com/manufacturing/2013/06/checkout-checkin-a-file-in-vault-2014.html

 

Here is the discussion that led  to this blog post

http://forums.autodesk.com/t5/Vault-Customization/Checking-in-and-out-a-file/m-p/4310663/highlight/t...

 

cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 3 of 12

Hello Vladimir Ananyev,

Thank You for your response.

I initially refered the links specified by you, i can use that to checkout/checkin individual files. It will not checkout the file with references.

I want to do the checkout/checkin operation using inventor API.

Any other method?

Cheers,

Regards
Santosh



I am working on Vault 2013 with Visual Studio 2010.
Regards
Santosh
Message 4 of 12

Santosh

 

I am going through this process at the moment.

 

I have developed a GUI which uses both VAULT API and Inventor API functionality.

The VAULT API breaks any links between the iam, ipt and idw files. I use the vault API to check out only.

 

To check in the files i am opening the IDW files and using the m_inventorApplication.CommandManager.ControlDefinitions.Item("VaultCheckinTop").Execute(). This checks in associated parts and assemblies.  Not sure the differences between execute() and execute2().

 

I am having a inconsistant results. If I manually open the drawing prior to running my GUI and just select my button that issues the VaultCheckInTop command it all is fine. The associated iam, ipt and the idw file all check in to vault OK.

 

if i use my code to search through vault to identify the drawing, open the drawing through my code from the working directory and then issue the VaultCheckInTop command only the iam and ipt files get checked in. The drawing opens but does not get checked in. I am trying to understand why as i type. It appears to be something to do with opening the drawing using the API rather than directly from inventor.

 

have you progressed with your development ?

 

 

regards


Wayne

 

Message 5 of 12
cadull_rb
in reply to: wayne.forrest

In order to use the Inventor Vault addin commands, the document must have been opened visibly and be the active document. It is not sufficient to make the document visible after opening invisibly. To open a document I use code similar to:

 

string filename = "... full path to file ..."
NameValueMap fileOpenOptions = Application.TransientObjects.CreateNameValueMap();
fileOpenOptions.Add("FileVersionOption", FileVersionEnum.kOpenCurrentVersion);
fileOpenOptions.Add("DesignViewRepresentation", ""); // omit for idw
Document document = Application.Documents.OpenWithOptions(filename, fileOpenOptions, true);
if(Application.ActiveDocument!=document) document.Activate();

 

I also find it helpful to execute a "VaultRefresh" command before the check in, as there can be a discrepancy between which files Inventor and the Vault addin believe need saving.

 

Regards,

cadull

Message 6 of 12

Yes. Wayne. There are inconsistent results. I have also tried the same method. And as CadUll said even if i open the idw then some times checkIn fails, and some times works.

I am still finding difficulty, requested help from Autodesk, but seems it has been added to wish list.
Regards
Santosh
Message 7 of 12
santoshr0114
in reply to: cadull_rb

Yes Cadull. The document should be visible. I tried running the inventor instance opening graphically and opening the document, check if it is the active document, if not set as active document and then checkin(Vault AutoLogin enabled).

Even after this some times checkin fails. Then i need to maintain a log to check whether a file has been checked in or not. Which is becoming lengthy than i thought.

But i did not try VaultRefresh. I can try even that. But the files which i am working on does not have any discrepancies..
Regards
Santosh
Message 8 of 12
cadull_rb
in reply to: santoshr0114

My experience is more with iPart and iAssembly files rather than drawings, so you may be encountering issues that I haven't yet. At first I thought it would take a few days to write a batch utility to update our files ... this turned into 3 or 4 months.

 

I would check the Document.Dirty flag in all referenced documents, ensuring that all documents are saved (according to Inventor). The VaultRefresh command should get the Vault addin to agree with this status. You will need to decide what to do if a file needs saving but is not checked out to the user.

 

It can be worth checking for files that have been modified and saved without checking out. I also check for files that have a newer version in Vault.

 

Regards,

cadull

Message 9 of 12
wayne.forrest
in reply to: cadull_rb

All

 

ensuring the document is active rather than just opened seems to have resolved my issues.

I need to do more testing to ensure it works every time but thanks for the tip.

 

 

regards

 

Wayne

Message 10 of 12

Good that some thing helped you Wayne
Regards
Santosh
Message 11 of 12
santoshr0114
in reply to: cadull_rb

When the files are checked in i deal will all (ipt, iam, ipart, iassembly, idw, sometimes dwf). Some times when i check in there is no issue, and works fine.

The problem occurs when vault checkin is disabled. But when i open the same document manually then i am able to checkIn.

The option what i tried is saving the document, if the properties are updated then, version is created(I want to avoid this, thats y i dont save)

Let me try for some more time. As i am currently travelling i cannot try immediately.

Will try and if found a solution will surely post.
And also let me know if there is any other way to get this done.
Regards
Santosh
Message 12 of 12
akosi
in reply to: santoshr0114

I have the same problem. Can you help me?
("VaultCheckinTop") doesn't work for me . Do I need to import reference in my code?

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

Post to forums  

Autodesk Design & Make Report