Glyph Version 7.22.2 |
pw:: ScriptGlobal actions for controlling script behavior Derives FromSummary
ServerActive
This attribute is a flag for whether the Glyph Server is actively listening for client connections or not. Only client connections originating from the localhost will be responded to unless ServerAllowRemote is true. TypeThis attribute is a boolean value. DefaultThe default for this attribute is false or the value of the PWI_GLYPH_SERVER_ACTIVE environment variable, if it set. InformationIf this attribute is set to true and the current ServerPort is already in use, an alternate port that is not currently in use will be used, and the ServerPort attribute will be updated. ErrorsThis attribute cannot be set in non-interactive mode or through a Glyph Server connection. ServerPort
This attribute is the TCP port number of that the Glyph Server listens on for client connections. Only client connections originating from the localhost will be responded to unless ServerAllowRemote is true and ServerAuthentication is not an empty string. TypeThis attribute is an integer with the range [1025, 65536]. DefaultThe default for this attribute is 2807 or the value of the PWI_GLYPH_SERVER_PORT environment variable, if it is set. However, if the default port is in use by another application, a random port number that is unused will be assigned. InformationIf this attribute is modified and the Glyph Server is currently active it will be deactivated temporarily, the port changed and reactived. It is possible that errors will occur during this process leading to the Glyph Server becoming deactived. ErrorsThis attribute cannot be set through a Glyph Server connection. ServerAuthentication
This attribute is an authentication code used to authenicate the clients that attempt to connect to the Glyph Server. TypeThis attribute is a string with maximum length of 40. DefaultThe default for this attribute is an empty string or the value of the PWI_GLYPH_SERVER_AUTH environment variable, if it is set. ErrorsThis attribute cannot be set through a Glyph Server connection. ServerAllowRemote
This attribute is a flag for whether clients on remote hosts will be allowed to connect to the Glyph Server. In order for remote hosts to connect this attribute must be true and the ServerAuthentication attribute must be set to a non empty string. TypeThis attribute is a boolean. DefaultThe default for this attribute is false. ErrorsThis attribute cannot be set through a Glyph Server connection. DomainUnstructuredSkipMeshing
This attribute is a flag for whether meshing on unstructured domains should be skipped. The attribute value will be reset to the default value after script execution. TypeThis attribute is a boolean. DefaultThe default for this attribute is false. processServerMessages
This action processes incoming messages to the Glyph Server, which allows executing Glyph commands in Pointwise over a TCP port. Parameters
InformationThe Glyph Server protocol is a simple message based TCP protocol for executing glyph commands given by a client that connects to the Glyph Server. Each message sent to or from the server consists of a 4 byte network ordered (big-endian) unsigned integer with the value representing the length of the following message in bytes. Each message is further defined as starting with an 8 byte string denoting the type of message with spaces padding on the right, followed by a variable length string payload. After a client connects, it should immediately send an authentication message:
After the AUTH message has been sent, the server will send one of three messages:
The READY message signals to the client that messages will be accepted from the client by the server. The AUTHFAIL message will be send if the client couldn’t not be authenticated. The BUSY message will be sent when another client is currently connected to the Server or the Pointwise application is otherwise busy. The ERROR message will be sent for any other issue not covered by the above cases for which an established connection did not occur. After the READY message has been returned, the client may send one or more of the following messages:
The CONTROL message is handled by the Glyph Server by modifying or querying a setting of the Glyph Server. To modify a setting, the message should be in the form “setting=value”. To query a setting, the message should be just the name of the setting. After the message is received, the Glyph Server responds with one of two messages:
Control settings include: The EVAL message is handled by the Glyph Server by evaluating the Glyph command. Once complete, the Glyph Server responds with one of two messages:
The COMMAND message is handled by the Glyph Server by running the given Glyph command and parameters. The command and parameters must be actual values since no nested commands or variable substitution will be evaluated. Once completes, the Glyph Server responds with one of two messages:
The Glyph Server supports JSON according to RFC 7159, which supports boolean, number and string values at the top level. When a Glyph command returns a single value, it will be returned as a value at the top level of the JSON data. The PING message is handled by the Glyph Server by simply returning an OK message. This may be used to determine whether the client-server connection is still active. After the message is received, the Glyph Server will respond with the following message:
ErrorsThis action cannot be run through a Glyph Server connection. ReturnsThis action returns nothing. source
This action includes and executes the specified Glyph file with its own undo level. If the Glyph file is a self-contained script and modifies the undo stack, using this method instead of the standard Tcl source command will contain the undo changes within the script. Parameters
ReturnsThis action returns a boolean, which is true if the script executes successfully. createPointLink
This action creates a string that, when displayed in the Messages window, creates a link to a point or list of points. This only occurs when the command is run in interactive mode. In batch mode, no links are created. Instead, just a comma-separated list of the point values are generated. Parameters
ReturnsThis action returns a string value that can be used with the puts Tcl command. ExampleThis example shows how to create a link to an XYZ point. Code set cn(1) [create2PtConnector {0 0 0} {10 0 0} 21] Output Maximum located at <a href='pwpnt://pwi.app?loc=7.5 0.0 0.0'>point 15</a>." createEntityLink
This action creates a string that, when displayed in the Messages window, creates a link to a set of entities. This only occurs when the command is run in interactive mode. In batch mode, no links are created. Instead, the returned string value is a space-separate list of the entity function names. Parameters
ReturnsThis action returns a string value that can be used with the puts Tcl command. ExampleThis example shows how to create a link to a list of two entities. Code set cn(1) [create2PtConnector {0 0 0} {10 0 0} 21] Output Created <a href='pwent://pwi.app?ents=::pw::Connector_1 ::pw::Connector_2' title='New Connectors'>2 connectors</a>." createFileLinkThis action creates a string that, when displayed in the Messages window, creates a hyperlink to a file or directory. This only occurs when the command is run in interactive mode. In batch mode, no links are created. Instead, just the file or directory name is returned. Parameters
ReturnsThis action returns a string value that can be used with the puts Tcl command. ExampleThis example shows how to create a link to a file. Code set file [file join @SysInstall doc PDF Glyph.pdf] Output For reference: <a href='pwfile://@SysInstall/doc/PDF/Glyph.pdf'>Glyph Docs</a>." |
This attribute is a flag for whether the Glyph Server is actively listening for client connections or not.
pw::Script get/setServerActive active
This attribute is the TCP port number of that the Glyph Server listens on for client connections.
pw::Script get/setServerPort port
This attribute is an authentication code used to authenicate the clients that attempt to connect to the Glyph Server.
pw::Script get/setServerAuthentication code
This attribute is a flag for whether clients on remote hosts will be allowed to connect to the Glyph Server.
pw::Script get/setServerAllowRemote allow
This attribute is a flag for whether meshing on unstructured domains should be skipped.
pw::Script get/setDomainUnstructuredSkipMeshing skip
This action processes incoming messages to the Glyph Server, which allows executing Glyph commands in Pointwise over a TCP port.
pw::Script processServerMessages ?-authentication code? ?-allowRemote allow? ?-timeout seconds?
This action includes and executes the specified Glyph file with its own undo level.
pw::Script source filename
This action loads and initializes the Tk library for use in the script.
pw::Script loadTk
This action creates a string that, when displayed in the Messages window, creates a link to a point or list of points.
pw::Script createPointLink ?-title string? link_text points
This action creates a string that, when displayed in the Messages window, creates a link to a set of entities.
pw::Script createEntityLink ?-title string? link_text entities