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

Standard/Library Parts

Function Index Top of Page

SD-INQ-OBJ-LIBRARY-P  [function]

(sd-inq-obj-library-p object)
Description:
Determines if the given object is a library object, i.e. whether a library attribute is attached and the symbolic name is set.

Parameters:
object {SEL_ITEM} - the object to inquire

Return value:
T - if the object is a library object
nil - otherwise

Function Index Top of Page

SD-SET-LIBRARY-ATTR  [function]

(sd-set-library-attr object library-id library-name )
Description:
Library elements are elements created by a special description multiple times, but only one of them is created to the database making sure that all references to such a library element use the one representation of the element in the database.
This function marks a element as library element by setting a library-identifier (library-id_library-name) and sets it to "read-only". At store to the database the element will be put into the LIBRARY_3D class. If a element with the same library-identifier already exists in the database LIBRARY_3D class the element will not be stored and the existing library element in the database will be referenced. The element in Creo Elements/Direct Modeling will not be replaced with the element from the database. To align the Creo Elements/Direct Modeling model with the database use the "reload" function.
When an assembly will be made a library element all the children have to be library elements.
Remark: before adding any kind of references (dimensions, relations .... ) to a library element an alignment with the database is recommended. The sysid of the library element often change at this update.

An database alignment could be done by:

  1. Check if the element is already in the database, if not ...
  2. Store the element to the database.
  3. Reload the element from the database.

Parameters:
element {LISP object}
- sel-item of the element
library-id {STRING}
The library-id is used to distinguish elements 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 therefore not be used.

  • BK
  • BL
  • BL2
  • CCF
  • CCM
  • CCS1
  • CCS2
  • DDST
  • DP1
  • DP2
  • DST
  • EG
  • EG2
  • EG3
  • EPIN
  • ES
  • ES2
  • ESLV
  • FE
  • LR
  • LS
  • OR1
  • OR2
  • OSD
  • PSOL
  • RT
  • SB
  • SC
  • SC2
  • SC3
  • SC4
  • SC5
  • SP
  • SPR
  • SST
  • WDST
  • WP1
  • WP2
  • WP3
  • YST
library-name {STRING}Name of the library element
The library-name must not be empty and must not contain a '@'.

Return Value:
t - library-id and library-name had been correct and the element could be marked as library element. nil failure The following error(s) might be reported by the function sd-get-library-attr-error

Example:
(setq name-in-library (sd-set-library-attr element "ScrewCompanyMiller" "Screw_M8_T60" ))
(format t "Library-Identifier: ~A" name-in-library)

Output:
    Library-Identifier: ScrewCompanyMiller_Screw_M8_T60

Function Index Top of Page

SD-GET-LIBRARY-ATTR-ERROR  [function]

(sd-get-library-attr-error)
Description:
Returns error reported by the last call of sd-set-library-attr.

Return Value:
Error code - see return values of sd-set-library-attr
nil - No error

Example:
(sd-get-library-attr-error)

Function Index Top of Page

SD-GET-LIBRARY-ATTR  [function]

(sd-get-library-attr element )
Description:
This function returns a list containing the library-identifier and the library-id of an element.

Parameter:
element {LISP object}
- sel-item of the element

Return Value:
List - containing library-indentifier and library-id.
Is the element not a library-element both values are nil

Example:
(format t "~A" (sd-get-library-attr element))

Output:
   (ScrewCompanyMiller_Screw_M8_T60 ScrewCompanyMiller)
[Integration Kit Contents] [Integration Kit What's New] [Integration Kit Function Index] [More Documentation] [PTC]
© 2023 Parametric Technology GmbH
(a subsidiary of PTC Inc.), All Rights Reserved