[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]

Creo Elements/Direct Modeling / Creo Elements/Direct Drafting Communication: Functions

This document is about what functions are to be used to execute commands in Annotator (special version of Creo Elements/Direct Drafting) as well as to receive data from Annotator in Creo Elements/Direct Modeling.

Function Index Top of Page

SD-EXECUTE-ANNOTATOR-COMMAND  [function]

(sd-execute-annotator-command :cmd "Command")
Description:
This function executes a command inside the Creo Elements/Direct Drafting. The function terminates as soon as the Creo Elements/Direct Drafting finished the execution of the command.

Parameters:
cmd {STRING} - String containing the statement to be executed by the Creo Elements/Direct Drafting It must be a valid Creo Elements/Direct Drafting command

Return Value:
no return value - always

Function Index Top of Page

SD-EXECUTE-ANNOTATOR-FUNCTION  [function]

(sd-execute-annotator-function :fnc "Function")
Description:
sd-execute-annotator-function executes a function inside the Creo Elements/Direct Drafting. It terminates as soon as the Creo Elements/Direct Drafting finished the execution of the command and returns a LISP form. This LISP form has been sent from the Creo Elements/Direct Drafting to Creo Elements/Direct Modeling.

It is important to know that the command called must return a LISP form to Creo Elements/Direct Modeling. This can be done using the Creo Elements/Direct Drafting macros described below.

Parameters:
fnc {STRING} - String containing the statement to be executed by the Creo Elements/Direct Drafting It must be a valid Creo Elements/Direct Drafting function

Return Value:
any LISP form - always

Function Index Top of Page

SD-GET-ANNOTATOR-POSITION  [function]

(sd-get-annotator-position :object object-selected)
Description:
sd-get-annotator-position returns a string containing the x and y coordinates of the Creo Elements/Direct Drafting object selected. x and y are separated by a ','.

Parameters:
object {SEL_ITEM} - Creo Elements/Direct Drafting object selected It must have been inquired as described here

Return Value:
a string containing x and y coordinate of the object selected
e.g. "23.322444342,12.32435245" or
nil in case the object is not an Creo Elements/Direct Drafting object.

Function Index Top of Page

SD-GET-ANNOTATOR-REFERENCE  [function]

(sd-get-annotator-reference :object object-selected)
Description:
sd-get-annotator-reference returns a number representing the id of the Creo Elements/Direct Drafting object selected. This id can be used by the Creo Elements/Direct Drafting command SELECT with keyword POINTER

Parameters:
object {SEL_ITEM} - Creo Elements/Direct Drafting object selected It must have been inquired as described here

Return Value:
a number being the id of the object selected
e.g. 23421232 or
nil in case the object is not an Creo Elements/Direct Drafting object.

Function Index Top of Page

Note

When executing a valid Annotator command / function it is important to keep the concept of drawing / sheet structure and the current part the Annotator (Creo Elements/Direct Drafting) is using. To avoid subsequent problems follow the recommendation below.

Definition: Valid Creo Elements/Direct Drafting command

A valid Creo Elements/Direct Drafting command is any Creo Elements/Direct Drafting command or macro fulfilling the requirements listed below:
It is important to know that Creo Elements/Direct Drafting commands awaiting input from the user have to get this input from Creo Elements/Direct Modeling. This is true for all kinds of input.
Example: if you send a command awaiting a mouse pick it is not sufficient to pick into the viewport. Creo Elements/Direct Modeling has to send the pick to Creo Elements/Direct Drafting using sd-execute-annotator-command():
   (sd-execute-annotator-command :cmd "12.345678,98.765432")
How to receive a coordinate in Creo Elements/Direct Modeling Dialogs can be found here.

Definition: Valid Creo Elements/Direct Drafting function

A valid Creo Elements/Direct Drafting function is any Creo Elements/Direct Drafting Command or Macro fulfilling the requirements listed below:

Recommendations when executing annotator commands / functions

Avoid leaving the wrong active part by restoring the last state after the customized action is finished.

Function Index Top of Page

SD-AM-ERRORS  [function]

(sd-am-errors option)
Description:
Handling of errors reported from Creo Elements/Direct Drafting

Parameters:
option {KEYWORD} - specifies the return value or action
:get_all (default) - returns a list of first and last errors
:get_first - ask for first reported error
:get_last - ask for last reported error
:clear - resets the errors to "NOERROR"

Return Value:
depending on the option KEYWORD
:get returns errors {PROPERTY LIST} (:first .... :last ...) or nil
:get_first returns error {STRING} or nil
:get_last returns error {STRING} or nil
:clear returns T

Example:
(sd-am-errors :get_last)
[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]
© 2019 Parametric Technology GmbH
(a subsidiary of PTC Inc.), All Rights Reserved