hm_libraryget

Query information from a connected library.

General Syntax

hm_libraryget entitytype request_type option1=<value1> option2=<value2> … option=<valueN>

Request Specific Syntaxes

For request_type set to “status”:

hm_libraryget entitytype status status_to_query

For request_type set to “finditems”:

hm_libraryget entitytype finditems ?uid=<value>? ?major_revision=<value>? ?study_revision=<value>? ?resulttype=<value>?

For request_type set to “iteminfo”, “repinfo”, or “ revisioninfo”:

hm_libraryget entitytype iteminfo|repinfo|revisioninfo attribute_list mark=<value>|uid=<value> major_revision=<value> study_revision=<value>|library_id=<value> ?resultkey=<value>?

For request_type set to “viewerdata”:

hm_libraryget entitytype viewerdata UID_list attribute_list ?major_revision=<value>? ?study_revision=<value>?

Type

HyperMesh Tcl Query Command

Description

This command queries information from a connected library. The command has six different types of requests to retrieve different types of information from the library.

Each request type has different available inputs (some are optional).

Inputs

entitytype
The type of connected library. Valid values are subsystems and parts.
request_type
The type of library request. Valid values are:
status - Get general information from the library for the specified entity type.
finditems - Locate items from the library like a filter command. You must supply one or more of the identifying triads (UID, major revision, and study revision) to locate items in the library.
iteminfo - Get attributes from library item(s) specified via additional arguments.
repinfo - Get attributes from the representations of library item(s) specified via additional arguments.
revisioninfo – Get revision information for the representations of library item(s) specified via additional arguments.
viewerdata - Get full revision information with attributes for the representations of library item(s) specified via the provided list if UIDs.
mark=<value>
The ID of the entity mark. Valid values are 1 and 2.
uid=<value>
The UID of the entity.
major_revision=<value>
The major revision of the entity.
study_revision=<value>
The study revision of the entity.
resultkey=<value>
For requests that allow this option, it specifies the type of output to be generated. Valid values are hm_proto_id and triad (that is, the triple of information – UID, major revision, and study revision).
resulttype=<value>
For requests that allow this option, it specifies the type of output to be generated. Valid values are library_id and triad.
status_to_query
Valid request_type “status”. Specifies the information to retrieve. Valid values are “isHmILibraryEnabled“, “isLibraryOpen, and "getActiveLibrary".
attribute_list
For requests that allow this option, it specifies the type of attributes to be returned in the resulting information retrieved from the library.
UID_list
For the “viewerdata” request, it provides a means to specify the list of UIDs of the item(s) to search for in the library.

Examples

To check if subsystems library is connected:
hm_libraryget subsystems status "isLibraryOpen"
To find all items in the parts library which have a UID of ‘PART1’ and a major revision of ‘A’:
hm_libraryget parts finditems uid=PART1 major_revision=A
To retrieve the library IDs for any located items matching the ones in the HyperMesh session for subsystems ID 4, 5, and 6:
*createmark subsystems 1 4 5 6
hm_libraryget subsystems iteminfo [ list "id" ] mark=1

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

2025.1