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: 

Creating and setting UDPs

7 REPLIES 7
Reply
Message 1 of 8
jsjk
724 Views, 7 Replies

Creating and setting UDPs

I need to create several UDPs and then set the values for each one.

I don’t understand how to use AddPropertyDefinition.  I can’t figure out how to get what I need to pass in the entityClassCtntSrcPropDefs parameter.  Anyone have an example of the correct usage of AddPropertyDefinition and how to get all the required inputs?

 

Also having problems setting the value of an existing UDP.  I keep getting a SoapException # 1013.  What does this mean?

 

Thanks

7 REPLIES 7
Message 2 of 8
jsjk
in reply to: jsjk

Figured it out.

FYI,

For unmapped properties passing null for the entityClassCtntSrcPropDefs parameter.

 

UpdateFileProperties take the MasterID of the file, not fileID.

Message 3 of 8
Redmond.D
in reply to: jsjk

I recommend using the Vault Explorer client, if possible, for setting up UDPs.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 4 of 8
jsjk
in reply to: Redmond.D

Why is that?  Are there certain things I should be doing or not doing when setting up the UDPs?

 

My plan is to have several UDPs in place so they can be set later based on information in Inventor files.  This initial creation would be a one time setup by a user with the appropriate permissions.

Message 5 of 8
dlconsulting
in reply to: jsjk

While we're on the topic of setting UDPs I had a couple questions and can't find answers in either examples or docs...

1) the UpdateItemProperties function takes three parameters, the first being itemRevIds.  Is this an array of file and/or folder IDs?

2) I'm assuming all 3 arrays (itemREvIds, propDefIds, and values) are all the same size, true?

3) It it acceptable to use ArrayLists instead of arrays? 

4) In the docs it says "The Item needs to be in an editable state prior to calling this function".  Does this simply mean not checked out, or are there other things one needs to do to get it into an editable state?

5) Following up in #4, what's the recommended way to lock the item prior to updating properties?

Thanks for any suggestions.  The good news is that this is the last big nut to crack on this particular project.  🙂

Dan

Message 6 of 8
Redmond.D
in reply to: dlconsulting

The reason I recommened using Vault Explorer for creating UDP definitions is because it's easier.  If you are only doing a one time creation, then it's easiest to just use the UI.  But in cases where the UDP is getting added over and over again or you have a large set of UDP definitions, then the API is the way to go.

 

If you want to edit a file UDP value, you need to call DocumentService.UpdateFileProperties(...).  The ItemService relates to the Item feature in Vault Professional.

No you can't pass in the ArrayList.  I personally prefer the List<> class over array list because it is type-safe, you aren't constantly converting from Object.  Also List<> has a ToArray function that easily converts it to an array.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 7 of 8
dlconsulting
in reply to: Redmond.D

Ha!  Got it.  More fun than figuring out Sodoko.  Thanks!

Message 8 of 8
nick801
in reply to: jsjk

I want to generate mapped UDP’s by API and I don’t understand how the AddPropertyDefinition works.
I can list all the property definition values from existing mapped properties searching through theProperty.EntClassCtntSrcPropCfg array and also store these values in a newProperty.EntClassCtntSrcPropCfg and generate a new UDP with this values.
The AddPropertyDefinition asks for an entityClassCtntSrcPropDefs() as EntClassCtntSrcPropCfg.
How to declare and fill a new entityClassCtntSrcPropDefs() array for a new mapped UDP?

 

Thanks in advance.

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

Post to forums  

Autodesk Design & Make Report