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: 

How to obtain the numberingSchemeId

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
543 Views, 2 Replies

How to obtain the numberingSchemeId

I am trying to add new Items to Vault 2013 Professional through the API.

 

It seems like I need to use the itemSvc.AddItemNumbers() method to assign the Item Number that I want to my new Item.

 

That method needs a parameter called numberingSchemeId.  Our Item numbering schema is called "Mapped" and is the default item numbering schema.

 

How can I obtain the ID for this numbering scheme?

 

 

2 REPLIES 2
Message 2 of 3
Redmond.D
in reply to: Anonymous

Call GetNumberingSchemesByType and loop through the results until you find the NumSchm object that you want.  From your message, it sounds like you are looking for the scheme where Name == "Mapped" or the scheme where IsDflt == true.

 



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 3
Anonymous
in reply to: Redmond.D

Thanks Doug, that seems to work:

//==============================================

private long GetItemNumberingSchemeID(string schemaName)

{

   long sId = 0;

 

   NumSchm[] allSchemes = itemSvc.GetNumberingSchemesByType(NumSchmType.All);

 

   foreach (var schema in allSchemes)

       {

      if(schema.Name == schemaName)

              {

                    sId = schema.SchmID;

                    break;

              }

      }

 

   return sId;

}

 

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

Post to forums  

Autodesk Design & Make Report