Properties in Vault 2011 – Part 3

This article will focus on Item properties, so feel free to skip this one if you are not using Vault Professional or do not use Items.  If you haven't read the article on Entities, you might want to do that first.  And, obviously, parts 1 and 2 should be read.

Item Properties
Items is one of those features where the UI makes it look like things work one way, but at the API level, things are completely different.  Unmapped Item UDPs are pretty straightforward.  It's when you get into mapped properties that things get confusing.

For example, take the following workflow:

  1. Create a new Property
  2. Associate it to File and Item
  3. Set up the File mappings
  4. Save the Property
  5. Upload a file with the property in it.  The UDP contains the expected value.
  6. Assign the file to an item. 
  7. The item does not contain the UDP value like you might expect.  The reason is that you still need to set up the Item mapping.  The file value doesn't automatically copy over to the item just because the Item box is checked on the property.

Mappings
Items also support mapping between UDP and a Content Source Property.  But the meaning is different for Items.  Item properties do not map to data within the file. 

You know that 'bom' parameter on the add and checkin functions?  That's what Item properties map to.  The BOM contains bill of materials data for the file.  The central objects in the BOM are the BOMComp objects.  BOMComp objects can map to Item objects.  Therefore BOMProp objects are what the Item UDPs map to.

Content Source Providers
So Item properties still have the concept of a content source property.  But the file's BOM is the content source in this case, not the file itself.  Again, the content source provider is the glue that hooks the content source property to the UDP.  So depending on the file type, the Item mapping behavior may be different.

Reference Designators
This is the only other entity class that supports property mappings.  Just like with Items, a Reference Designator property maps to data in the BOM.  The only difference is that the mapping is to BOMProp data on a BOMRefDesig object.

AutoCAD Electrical is the only application that sets reference designator BOM data.  So mappings are only possible with the content source provider that handles .dwg files. 

Next up…
In the fourth and final article, sample code!


Comments

6 responses to “Properties in Vault 2011 – Part 3”

  1. Till Klingenberg-Scholle Avatar
    Till Klingenberg-Scholle

    Hello Doug,
    first of all I want to pay respect for your create blog. It is very informative and helps me along with my work. But I’ve got one question; Is there a possibility to change Content Source Properties? e.g. I made a custom tab with different properties displayed in it, some are user defined, others are system props. well, changin user defined props and updating them isn’t that difficult. But when it comes to change the title in a dwg block I fail. Do you have a clue?? I’d be very grateful.
    Best Regards
    Till Klingenberg-Scholle

  2. You can edit the content source property, but not through the Vault API. You need to edit the CAD file directly using the appropriate CAD API.
    Here are the basic steps:
    1. Check out the file through the Vault API.
    2. Update the property in the local file through the CAD API.
    3. Check in the file through the Vault API.

  3. Till Klingenberg-Scholle Avatar
    Till Klingenberg-Scholle

    Thank you for your quick answer. I’ll try it soon.
    Greetings and a nice weekend

  4. Tobias Degen Avatar
    Tobias Degen

    Hi Doug
    I am not sure if I understand that correctly, could you enlighten me…?
    I create a UDP and assign it to file and item. It shall be a property that the user must provide through the Vault Explorer, so there is no Property Provider for it. How can I map this UDP to an item UDP…?
    Thanks, Tobias

  5. Let me restate the question to make sure I understand: You have a UDP associated with “FILE” and “ITEM” entity classes. The UDP has no file or item mappings. The user enters the UDP value on the file, and you want the same value on the UDP of the item which is linked to the file.
    That functionality is not supported. Associating a UDP to “FILE” and “ITEM” just means that the property definition can be applied to both items and files. It does not mean that the property values can be mapped.
    Of course, you can fix things up with custom programming. You can have a utility set the item UDP, or the utility can find the file UDP value for a given item.

  6. Pawel Jackowski Avatar
    Pawel Jackowski

    Thanks for good post.
    We are working with File BOM and we are encountering ugly exception.
    We are using function to read BOM DocumentService.GetBOMByFileId and very often we get exception Eplan.Vault.Base.Exceptions.VaultException: [0:UnspecifiedSystemException].
    Do you have any experience with this kind of problem?
    Thanks,
    Pawel

Leave a Reply

Discover more from Autodesk Developer Blog

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

Continue reading