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

Direct Database Functions

Function Index Top of Page

SD-DB-ELEMENT-LOAD  [function]

(sd-db-element-load :identifier identifier(s)
                    :database-elid database-elid
                    :database-type database-type
                    :database-part-elid database-part-elid
                    :simplification simplification
                    :load-mode load-mode
                    :show-progress show-progress)
Description:
ModelManager only:
Loads an element from the database identified by identifier or database-elid and returns this element as a sel-item. The optional parameters database-type, database-part-elid and simplification-value-list have additional influence on search for the part. load-mode defines how the data should be loaded. Warning: sd-call-cmds may be needed.
Parameters:
identifier*1) {STRING, LIST of STRINGs}
String containing the name of a model or library part.
or
List with the symbolicname and the symbolicversion for a library part.
database-elid*1) {STRING}
String containing the database elid of a model or library part.
database-type {KEYWORD or STRING}
KEYWORD
  • :model
  • :library
A {STRING} is used directly as the database search type. This can be found in the Mapping section of the XML file that Model Manager uses.
Default strings (with respect to Creo Elements/Direct Data Base Products) are
  • "MODEL"
  • "LIBRARY"
database-part-elid {STRING}
String containing the elid of a masterdata related to this element. The element will be loaded with this masterdata metadata. In case the masterdata with database-part-elid does not exist or is not related to this element this value will be ignored.
simplification {STRING}
Name of simplification.
load-mode {KEYWORD}
Load-mode must be one of the following
  • :partial
    for a partial load.
  • :full
    for full load (this is default)
  • :graphics
    for graphics only load.
show-progress {KEYWORD}
Show-progress must be on of the following
  • :on shows the progress window
  • :off hides the progress window
*1) :identifier and :database-elid are exclusive
Return Value:
loaded-objects {LIST of SEL_ITEMs} - success
a list of sel-items of the elements loaded from the database
nil - failure
The following error(s) might be reported by the function sd-db-errors
  • ELEMENT_NOT_FOUND : The specified element was not found in the database
  • COMMUNICATION_ERROR : Error in communication to database. A retry might help
  • NO_FILE_RECEIVED : Element was found. But it's type is unknown.
Example:
(sd-db-element-load  :identifier "BR-BFWPK78Q2VLHIM" :database-type :model)
(sd-db-element-load  :identifier '("BR-BFWPK78Q2VLHIM") :database-type :model :load-mode :partial)
(sd-db-element-load  :identifier '("@FITTING@10@DAA$90#@" "00000002000003e8") :database-type :library))
(sd-db-element-load  :database-elid "BFXFZS6I2VLHIM")

Function Index Top of Page

SD-DB-ELEMENT-RELOAD  [function]

(sd-db-element-reload sel-item 
                      :identifier identifier(s)
                      :database-elid database-elid
                      :database-type database-type
                      :database-part-elid database-part-elid
                      :simplification simplification-value-list
                      :load-mode load-mode
                      :show-progress show-progress)
Description:
ModelManager only:
Reloads an element from the database identified by identifier or database-elid and returns this element as a sel-item. The optional parameters database-type, database-part-elid and simplification-value-list have additional influence on search for the part. load-mode defines how the data should be loaded. Warning: sd-call-cmds may be needed.
Parameters:
sel-item {SEL_ITEM} the item to reload.
identifier*1) {STRING, LIST of STRINGs}
String containing the name of a model or library part.
or
List with the symbolicname and the symbolicversion for a library part.
database-elid*1) {STRING}
String containing the database elid of a model or library part.
database-type {KEYWORD or STRING}
KEYWORD
  • :model
  • :library
A {STRING} is used directly as the database search type. This can be found in the Mapping section of the XML file that Model Manager uses.
Default strings (with respect to Creo Elements/Direct Data Base Products) are
  • "MODEL"
  • "LIBRARY"
database-part-elid {STRING}
String containing the elid of a masterdata related to this element. The element will be loaded with this masterdata metadata. In case the masterdata with database-part-elid does not exist or is not related to this element this value will be ignored.
simplification {STRING}
Name of simplification.
load-mode {KEYWORD}
Load-mode must be one of the following
  • :partial
    for a partial load.
  • :full
    for full load (this is default)
  • :graphics
    for graphics only load.
show-progress {KEYWORD}
Show-progress must be one of the following
  • :on show the progress window
  • :off hide the progress window
*1) :identifier and :database-elid are exclusive
Return Value:
reloaded-object {SEL_ITEMs} - success
a sel-items of the element reloaded from the database
nil - failure
The following error(s) might be reported by the function sd-db-errors
  • ELEMENT_NOT_FOUND : The specified element was not found in the database
  • COMMUNICATION_ERROR : Error in communication to database. A retry might help
  • NO_FILE_RECEIVED : Element was found. But it's type is unknown.
Example:
(sd-db-element-reload sel-item :identifier "BR-BFWPK78Q2VLHIM" :database-type :model)
(sd-db-element-reload sel-item :identifier '("BR-BFWPK78Q2VLHIM") :database-type :model :load-mode :graphics)
(sd-db-element-reload sel-item :identifier '("@FITTING@10@DAA$90#@" "00000002000003e8") :database-type :library))
(sd-db-element-reload sel-item :database-elid "BFXFZS6I2VLHIM")

Function Index Top of Page

SD-DB-ELEMENT-EXISTS  [function]

(sd-db-element-exists :database-elid database-elid)
(sd-db-element-exists :identifier identifier(s) :database-type database-type)
Description:
ModelManager only:
Checks the existance of an element in the database. The element is identified by identifier or database-elid. The function returns t when the element is in the database and nil when the element is not in the database or in case of an error.
Parameters:
database-elid*1) {STRING}
String containing the database elid of a model or library part.
identifier*1) {STRING, LIST of STRINGs}
String containing the name of a model or library part.
or
List with the symbolicname and the symbolicversion for a library part.
database-type {KEYWORD or STRING}
KEYWORD
  • :model
  • :library
A {STRING} is used directly as the database search type. This can be found in the Mapping section of the XML file that Model Manager uses.
Default strings (with respect to Creo Elements/Direct Data Base Products) are
  • "MODEL"
  • "LIBRARY"
*1) :identifier and :database-elid are exclusive
Return Value:
elid - element exist in the database, then the database elid is returned
nil - element does not exist in the database or failure
The following error(s) might be reported by the function sd-db-errors
  • COMMUNICATION_ERROR : error in communication to data base. A retry might help.
Example:
(sd-db-element-exists  :identifier "BR-BFWPK78Q2VLHIM" :database-type :model )
(sd-db-element-exists  :identifier '("BR-BFWPK78Q2VLHIM"  :database-type :model ))
(sd-db-element-exists  :identifier '("@FITTING@10@DAA$90#@" "00000002000003e8"  :database-type :library)))
(sd-db-element-exists  :database-elid "BFXFZS6I2VLHIM")

Function Index Top of Page

SD-DB-ELEMENT-STORE  [function]

(sd-db-element-store element :thumbnail-creation thumbnail-creation
                             :show-progress show-progress)
Description:
ModelManager only:
Store an element to the database. Warning: sd-call-cmds may be needed.
Parameters:
element {SEL-ITEM} Element to be stored
thumbnail-creation {KEYWORD}
  • :ON with thumbnail creation.
  • :OFF without thumbnail creation.
show-progress {KEYWORD}
  • :ON show the progress window.
  • :OFF hide the progress window.
Return Value:
t - success
nil - failure
The following error(s) might be reported by the function sd-db-errors
  • DUPLICATE_NAME :
  • DUPLICATE_PART_NAME :
  • COMMUNICATION_ERROR : error in communication to data base. A retry might help.
Example:
(sd-db-element-store (sd-inq-curr-part))
(sd-db-element-store (sd-inq-curr-part) :thumbnail-creation :on)
(sd-db-element-store (sd-inq-curr-part) :thumbnail-creation :on :show-progress :off)

Function Index Top of Page

SD-DB-ELEMENT-ELID  [function]

(sd-db-element-elid element)
Description:
Returns the data base element identifier of the element for document and part.
Parameters:
element {SEL-ITEM} Element to get the database-elid from.
Return Value:
database-elid {STRING} - the element identifier of the document
database-part-elid {STRING} - the element identifier of the part (masterdata)

or
nil - element has no database-elid attached
Example:
(sd-db-element-elid (sd-inq-curr-part))
-> "BG33NPT3KPM3G2"

(multiple-value-setq (elid part-elid) (sd-db-element-elid (sd-inq-curr-part)))
-> "BWKDZ1MI2VLHIC" "BWKDZ1MQ2VLHIC"  

Function Index Top of Page

SD-DB-ERRORS  [function]

(sd-db-errors option)
Description:
ModelManager only:
Report of errors*1) reported from sd-db-element* functions
Parameters:
option {KEYWORD [:get_all]} - specifies the return value or action
:get_all (default) - returns a list of all errors stored
:get_first - ask for first reported error
:get_last - ask for last reported error
:clear - resets the stored errors to "NOERROR" / NIL
Return Value:
depending on the option KEYWORD
:get_all returns errors {LIST-OF-STRINGs} (first-error... last-error) or nil
:get_first returns error {STRING} or nil
:get_last returns error {STRING} or nil
:clear returns T
*1) The number of subsequently errors hold in memory is limited to 32.
Example:
(sd-db-errors :get_last)

Function Index Top of Page

SD-DB-ELEMENT-BUILD-IDENTIFIER  [function]

(sd-db-element-build-identifier library-id
                                library-name)
Description:
Returns the identifier used in the data base from the parameters to mark a library part by using the function sd-set-library-attr.
Parameters:
library-id {STRING}
The library-id is used to distinguish parts of different libraries. The library-id and library-name joined by a '_' are used as the library-identifier, which is used as name in the LIBRARY_3D class. To avoid name collisions we suggest to use the name of your company as library-id . The library-id must not be empty and must not contain a '@'.

The following library-id s are already in use by Creo Elements/Direct Modeling libraries and can therefor not be used.

  • BL
  • BL2
  • BK
  • BK2
  • CCM
  • CCF
  • CCS1
  • CCS2
  • DP1
  • DP2
  • EG
  • ESLV
  • EPIN
  • ES1
  • ES2
  • LR
  • LS
  • OR1
  • OR2
  • OSD
  • RT
  • SB
  • SC
  • SC3
  • SC4
  • SP
  • WP1
  • WP2
  • WP3

The following library-id s are known to be in use by partner applications.

  • SCL
library-name {STRING}Name of the library part
The library-name must not be empty and must not contain a '@'.
Return Value:
identifier {STRING} - success, the identifier string
nil - failure, invalid library-id and/or library-name
Example:
(sd-db-element-build-identifier "ScrewCompanyMiller" "Screw_M8_T60")
-> "ScrewCompanyMiller_Screw_M8_T60"
(sd-db-element-exists :identifier
                      (sd-db-element-build-identifier
                          "SchraubenFirmaMayer" "Schraube_M8_T60"))
[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]
© 2024 Parametric Technology GmbH
(a subsidiary of PTC Inc.), All Rights Reserved