Vault Customization

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

How to obtain the numberingSchemeId

178 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?

 

 

Employee
Redmond.D
Posts: 800
Registered: ‎12-12-2006
Message 2 of 3 (157 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 (152 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;

}

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community