Is there a way in the API to get the item/part type name from an SID?
An example:
In the meta model, I have the item types "myItem" and "mySubItem" with their respective SIDs. The second item is a part of the first one with SID "PSID". I use the API to get the parts of an instance "item1" of the item "myItem", which gives me a list of items "mySubItem". In case "item1" does not yet have any parts with "PSID", I get an empty list, which is fine. In that case, I display an error message saying "The item 'item1' does not yet have any parts with SID 'PSID'". However, it would be much more readable if the message said "The item 'item1' does not yet have any parts of type 'mySubItem'".
How can I get the item type name (or the part type name) from the part SID?
Best Answer
S
SystemWeaver Support
said
over 6 years ago
Hello!
The following will return the item and part type name from a SID.
Stacey Hwasser
Is there a way in the API to get the item/part type name from an SID?
An example:
In the meta model, I have the item types "myItem" and "mySubItem" with their respective SIDs. The second item is a part of the first one with SID "PSID". I use the API to get the parts of an instance "item1" of the item "myItem", which gives me a list of items "mySubItem". In case "item1" does not yet have any parts with "PSID", I get an empty list, which is fine. In that case, I display an error message saying "The item 'item1' does not yet have any parts with SID 'PSID'". However, it would be much more readable if the message said "The item 'item1' does not yet have any parts of type 'mySubItem'".
How can I get the item type name (or the part type name) from the part SID?
Hello!
The following will return the item and part type name from a SID.
IswItemType itemType = SWConnection.Instance.Broker.swItemType("I");
string itemTypeName = itemType.Name;
IswPartType partType = SWConnection.Instance.Broker.swPartType("IDR");
string partTypeName = partType.Name;
Best regards,
SystemWeaver Support
Hello!
The following will return the item and part type name from a SID.
IswItemType itemType = SWConnection.Instance.Broker.swItemType("I");
string itemTypeName = itemType.Name;
IswPartType partType = SWConnection.Instance.Broker.swPartType("IDR");
string partTypeName = partType.Name;
Best regards,
-
Support for Autotest of API applications
-
Major version exception in API
-
Part multiplicity exception in API
-
Get enum attribute value description
-
Detecting connection status?
-
Adding an existing item as part to an item using C# API
-
Last Changed date isn't updating
-
Script filer och API
-
How do I return a DataTable instead of IswItems?
See all 19 topics