Vault Customization

Reply
Active Contributor
michael.collins2
Posts: 43
Registered: ‎03-30-2012
Message 1 of 3 (184 Views)
Accepted Solution

How to obtain the numberingSchemeId

184 Views, 2 Replies
09-28-2012 08:55 AM

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?

 

 

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.

 

Employee
Redmond.D
Posts: 814
Registered: ‎12-12-2006
Message 2 of 3 (163 Views)

Re: How to obtain the numberingSchemeId

10-01-2012 05:47 AM in reply to: michael.collins2

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.
http://justonesandzeros.typepad.com/

Active Contributor
michael.collins2
Posts: 43
Registered: ‎03-30-2012
Message 3 of 3 (158 Views)

Re: How to obtain the numberingSchemeId

10-01-2012 06:54 AM 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;

}

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.