I request came in for some examples of how to do Vault operations using vLogic.  So here you go.  You can never have too much sample code. 

Search.ps – This script runs an Item search.

SetItemProperty.ps1 – This script sets a property value on a set of selected Items.

RunChangeOrderActivity.ps1 – This script changes the state of a Change Order.

These scripts are basically ports of other API code examples floating around.  All I did was convert from C# or VB.NET to PowerShell syntax. 

I would like to point out that using a script doesn’t mean its any easier to program than a compiled app.  If you find a Vault API function difficult in VB.NET, then you will still find it difficult in PowerShell.  And vice versa.  Like most things, there is a trade-off.  For some things, scripting works great.  For other things, a compiled app is better.

I’m still new to PowerShell myself, but I’m hoping to come up with a tutorial or two on using vLogic.


Comments

4 responses to “vLogic Scripts”

  1. Patrick Fillion Avatar
    Patrick Fillion

    Is there a vlogic for vault 2014?

  2. It hasn’t been ported to Vault 2014 yet. I’m wondering if it’s worth the effort for me to maintain. I haven’t had much feedback on it.
    Are you currently using vlogic 2012 or 2013? If so what do you use it for?

  3. david.fletcher@standardmachine.ca Avatar
    david.fletcher@standardmachine.ca

    Hello Doug,
    I’m trying to use this tool to search Vault for a specific subset of our Inventor Drawings. I’m getting hung up on just running the basic “Search” Sample Code.
    When I installed the vlogic application, the sample code worked. Now I run the sample code, and I get the following:

    >
    Error: Exception calling “GetProperLyDefinitionsByEntityClassId” with “1”
    argument(s): “279”
    Error: Exception calling “FindItemRevisionsBySearchConditions” with “5”
    argument(s): “The request failed with HTTP status 404: Not Found.”
    >
    It has to be something simple, but if you have seen this before, can you please help me out?
    Thanks a lot,
    David

  4. My guess is that you are not connected to a Vault Professional server. So searching on items will fail because items are only in Vault Pro.
    Error “279” means InvalidEntityClassName. The “ITEM” type is only valid in Vault Pro.
    HTTP 404 means it can’t find the URL. If it’s not Vault Pro, there will be no ItemService URL.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading