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

Object Inquiries

sel_item

sd-inq-obj-pathname
sd-inq-obj-basename
sd-inq-obj-contents-name
sd-inq-obj-contents-sysid
sd-inq-obj-sysid

sd-inq-obj-mod-time

sd-pathname-to-obj
sd-pathname-to-pathlist
sd-pathlist-to-pathname

sd-sysid-to-obj

sd-gen-obj-basename

sd-inq-parent-obj
sd-inq-obj-children
sd-inq-obj-contents-read-only-p
sd-inq-obj-parent-contents-read-only-p
sd-inq-obj-instance-read-only-p
sd-inq-obj-parent-instance-read-only-p
sd-inq-obj-position-read-only-p
sd-inq-obj-contents-modified-p
sd-inq-obj-instance-modified-p
sd-inq-obj-untouchable-p
sd-inq-obj-lightweight-p
sd-inq-obj-partially-loaded-p
sd-inq-obj-selective-instance-p
sd-inq-obj-shared-objects

sd-inq-curr-part
sd-inq-curr-wp
sd-inq-curr-wp-exists-p

sd-inq-part-p
sd-inq-assembly-p
sd-inq-container-p
sd-inq-stock-container-p
sd-inq-workplane-p
sd-inq-wpset-p
sd-inq-face-part-p
sd-inq-wire-part-p
sd-inq-empty-part-p

sd-inq-simplified-object-p
sd-inq-simplification-owner-p
sd-inq-simplification-name
sd-inq-simplification-names
sd-inq-simplification-owner-id

sd-inq-obj-clipping-flag

Function Index Top of Page

SEL_ITEM  [structure]

(sel_item-type sel_item)
(sel_item-p sel_item)
Description:
The SEL_ITEM data structure (also called "select item") is used to represent any item in Creo Elements/Direct Modeling that can be interactively selected by the user. For example, a SEL_ITEM could refer to a part, an assembly, a 3d point, or a 2d point.

Select items come in two basic flavors: objects and elements. An item is called an object if its type is one of the following:

The following illustrates the hierarchical relationships between the various types of objects:

root "/"

An item is called an element if its type is anything except one of the above types (for example, a face, an edge, or a 2d point). However, since all elements must be owned by an object, an element item also contains a reference to the object that owns it. For example, an edge must be owned by a part, and a 2d line must be owned by a workplane. Another way to say this is that all items contain a reference to an object, but only element items also contain a reference to an element. The following figure illustrates that all items must have a type and a reference to an object, but may have a reference to an element:

Components of sel-item

Therefore, for functions that operate on objects, such as SD-INQ-OBJ-PATHNAME, it doesn't matter wether you pass in an object SEL_ITEM (such as a part) or an element SEL_ITEM (such as an edge on the part) since only the object portion of the SEL_ITEM will be used.

Slots:
Direct access to the actual data slots of a SEL_ITEM is not supported (except for the type slot) and generally not needed, since objects and elements are always referred to indirectly via a SEL_ITEM structure.

type {FIXNUM} - selection type

Function Index Top of Page

SD-INQ-OBJ-PATHNAME  [function]

(sd-inq-obj-pathname object)
Description:
Returns the pathname string representation of an object.

Parameters:
object {SEL_ITEM}

Return Value:
pathname {STRING}
The object's pathname (e.g. "/assy1/part1")

Function Index Top of Page

SD-INQ-OBJ-BASENAME  [function]

(sd-inq-obj-basename object)
Description:
Returns a string containing just the name of the object (not the entire path).

Parameters:
object {SEL_ITEM} - The object to inquire the basename of

Return Value:
basename {STRING} - The basename string (e.g. "part1")

Function Index Top of Page

SD-INQ-OBJ-CONTENTS-NAME  [function]

(sd-inq-obj-contents-name object)
Description:
Returns a string containing the contents name of the object, or NIL if the object does not have a contents name.

Parameters:
object {SEL_ITEM} - The object to inquire the contents name of

Return Value:
contents-name {STRING} - The contents name
nil - If object has no contents name

Function Index Top of Page

SD-INQ-OBJ-CONTENTS-SYSID  [function]

(sd-inq-obj-contents-sysid object)
Description:
Returns the unique sysid of the contents of an object.

Parameters:
object {SEL_ITEM} - The object to inquire the contents sysid of

Return Value:
sysid {STRING} - The contents sysid of the object.

Function Index Top of Page

SD-INQ-OBJ-MOD-TIME  [function]

sd-inq-obj-mod-time (object &optional attachment)
Description:
Returns the last modification time of the instance or the contents of an object.

Parameters:
object {SEL_ITEM} - The object to inquire the last modification time
attachment {KEYWORD [:instance]} - optional parameter
:instance - inquire the time of the object instance
:contents - inquire the time of the object contents

Return Value:
property-list {LIST} - A property list containing key/value pairs.

Example:
(sd-inq-obj-mod-time (sd-inq-curr-part))
=> (:YEAR 2000 :MONTH 1 :DAY 8 :HOUR 15 :MINUTES 0 :SECONDS 2)
(sd-inq-obj-mod-time (sd-inq-curr-part) :contents)
=> (:YEAR 2000 :MONTH 1 :DAY 9 :HOUR 16 :MINUTES 10 :SECONDS 53)

Function Index Top of Page

SD-INQ-OBJ-SYSID  [function]

(sd-inq-obj-sysid object)
Description:
Returns the unique sysid of the instance of an object.

Parameters:
object {SEL_ITEM} - The object to inquire the instance sysid of

Return Value:
sysid {STRING} - The instance sysid of the object.

Function Index Top of Page

SD-PATHNAME-TO-OBJ  [function]

(sd-pathname-to-obj pathname)
Description:
Converts an object pathname string to its item representation.

Parameters:
pathname {STRING}
The pathname string (e.g. "/part1") to convert

Return Value:
item {SEL_ITEM} - The item representation of the pathname
nil - No item with the specified pathname exists

Function Index Top of Page

SD-PATHNAME-TO-PATHLIST  [function]

(sd-pathname-to-pathlist pathname)
Description:
Parses a pathname into a list of its component names. For example, a pathname of the form: "/assy1/part1" is converted to ("/" "assy1" "part1"). The pathname does not necessarily have to correspond to an existing object.

Parameters:
pathname {STRING} - The pathname string to convert to a list of strings

Return Value:
pathlist {LIST of STRINGs}
A list of name strings that comprise the full pathname

Function Index Top of Page

SD-PATHLIST-TO-PATHNAME  [function]

(sd-pathlist-to-pathname pathlist)
Description:
Converts a list of name strings into a single pathname string. For example, a pathlist of the form: ("/" "assy1" "part1") is converted to: "/assy1/part1". The pathlist does not necessarily have to correspond to an existing object.

Parameters:
pathlist {LIST of STRINGs}
The list of name strings to convert into a pathname string.

Return Value:
pathname {STRING} - A pathname string (e.g. "/assy1/part1").

Function Index Top of Page

SD-SYSID-TO-OBJ  [function]

(sd-sysid-to-obj sysid &optional start-item)
Description:
Converts an object unique sysid to its item representation if found. Since multiple versions of that object can be present at the same time, a list of objects is returned. The search for the object starts with object start-item or with root "/" if no start-item is given.

Parameters:
sysid {STRING} - the unique sysid of an object
start-item {SEL_ITEM ["/"]} - optional object where search should start from

Return Value:
item {LIST of SEL_ITEMs} - The item representations of the sysid (including all versions)
nil - No item with the specified sysid exists

Function Index Top of Page

SD-GEN-OBJ-BASENAME  [function]

(sd-gen-obj-basename type :parent parent :prefix prefix)
Description:
Generates a unique object basename which may be used as child name of a new object in parent.
If prefix is not given, the name will be generated using the defaults which correspond to type.

Parameters:
type {KEYWORD}
used to determine the default prefix of the object name if prefix is set to nil.
One of the following keywords is allowed:
  • :part
  • :assembly
  • :container
  • :workplane
  • :wpset
  • :view-set
  • :docuplane-set
  • :coordinate-system
:parent {SEL_ITEM or STRING ["/" or nil]}
If this parameter is omitted and type is one of :part, :assembly, :container, :workplane or :wpset, this parameter defaults to "/".
If type is set to :layout this parameter must be set to either a part or assembly string or sel_item.
In all other cases this parameter may be either an object sel_item or the full path to an object as string (e.g. "/a1/p1").
:prefix {STRING}
Overwrites the system default prefixes for the different object types. This string must be a valid Creo Elements/Direct Modeling object name (part).
Note: Prefix strings starting with a "/" are not allowed. If you want to generate a whole new pathname and not only the basename use in addition to this function the function sd-pathlist-to-pathname.

Return Value:
basename {STRING} - the system generated string
nil - if something failed

Examples:
(sd-gen-obj-basename :part) => "p2"
(sd-gen-obj-basename :layout :parent "/p1") => "l1"
(sd-gen-obj-basename :workplane :prefix "temp-plane") => "temp-plane1"

Function Index Top of Page

SD-INQ-PARENT-OBJ  [function]

(sd-inq-parent-obj item)
Description:
Returns the parent object of an object or element item, or nil if the item has no parent. Objects below root ("/") return NIL as parent object.
The parent object of an element such as an edge is the owning part or workplane.

Parameters:
item {SEL_ITEM} - The item to inquire the parent object of

Return Value:
parent-object {SEL_ITEM} - The parent object
nil - The specified object does not have a parent

Function Index Top of Page

SD-INQ-OBJ-CHILDREN  [function]

(sd-inq-obj-children object)
Description:
Returns the child objects (only one level down) of an object.

Parameters:
object {SEL_ITEM} - The object to inquire the children of

Return Value:
child-objects {LIST of SEL_ITEMs} - The children of the object
nil - if the specified object has no children

Function Index Top of Page

SD-INQ-OBJ-CONTENTS-READ-ONLY-P  [function]

(sd-inq-obj-contents-read-only-p object)
Description:
Returns t if the contents of the object are read-only, and nil if they are modifiable.

Parameters:
object {SEL_ITEM}

Return Value:
t - if the object contents are read only
nil - if the object contents are modifiable

Function Index Top of Page

SD-INQ-OBJ-PARENT-CONTENTS-READ-ONLY-P  [function]

(sd-inq-obj-parent-contents-read-only-p object)
Description:
Returns t if the contents of the object's parent object are read-only, and nil if they are modifiable.

Parameters:
object {SEL_ITEM}

Return Value:
t - if the contents of the object's parent object is read-only
nil - if the contents of the object's parent object is modifiable

Function Index Top of Page

SD-INQ-OBJ-INSTANCE-READ-ONLY-P  [function]

(sd-inq-obj-instance-read-only-p object)
Description:
Returns t if the instance of the object is read-only, and nil if it is modifiable.

Parameters:
object {SEL_ITEM}

Return Value:
t - if the object instance is read-only
nil - if the object instance is modifiable

Function Index Top of Page

SD-INQ-OBJ-PARENT-INSTANCE-READ-ONLY-P  [function]

(sd-inq-obj-parent-instance-read-only-p object)
Description:
Returns t if the instance of the object's parent object is read-only, and nil if it is modifiable.

Parameters:
object {SEL_ITEM} - The object whose parent object to inquire

Return Value:
t - The instance of the object's parent object is read-only
nil - The instance of the object's parent object is modifiable

Function Index Top of Page

SD-INQ-OBJ-POSITION-READ-ONLY-P  [function]

(sd-inq-obj-position-read-only-p object)
Description:
Returns t if the position of the object is read-only, and nil if it is modifiable.

Parameters:
object {SEL_ITEM}

Return Value:
t - if the object position is read-only
nil - if the object position is modifiable

Function Index Top of Page

SD-INQ-OBJ-CONTENTS-MODIFIED-P  [function]

(sd-inq-obj-contents-modified-p object &key check-database)
Description:
Returns t if the contents of the object have been modified since being loaded into the system, and nil if they have not been modified.

Parameters:
object {SEL_ITEM} - The object to inquire
check-database {KEYWORD} - Flag controlling behavior for parts loaded from a database. If this parameter is set, additional checks for the modification status of parts loaded from the database will be performed. This parameter defaults to NIL.

Return Value:
t - The object contents have been modified since loading
nil - The object contents have not been modified since loading
Examples:
(sd-inq-obj-contents-modified-p (sd-inq-curr-part))

(sd-inq-obj-contents-modified-p (sd-inq-curr-part) :check-database t)

Function Index Top of Page

SD-INQ-OBJ-INSTANCE-MODIFIED-P  [function]

(sd-inq-obj-instance-modified-p object)
Description:
Returns t if the instance of the object has been modified since being loaded into the system, and nil if it has not been modified.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - The object instance has been modified since loading
nil - The object instance has not been modified since loading

Function Index Top of Page

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

(sd-inq-obj-untouchable-p object)
Description:
Returns t if the contents of the object has been marked as untouchable because it has lost references during load / reload from a database.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - The object contents has been marked as untouchable
nil - The object contents has not been marked as untouchable

Function Index Top of Page

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

(sd-inq-obj-lightweight-p object)
Description:
Returns t if the object is a lightweight object.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - The object is a lightweight object.
nil - The object is not a lightweight object.

Function Index Top of Page

SD-INQ-OBJ-PARTIALLY-LOADED-P  [function]

(sd-inq-obj-partially-loaded-p object)
Description:
Returns t if the object originally has been partially loaded from a database.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - The object has been partially loaded.
nil - The object has not been partially loaded.

Function Index Top of Page

SD-INQ-OBJ-SELECTIVE-INSTANCE-P  [function]

(sd-inq-obj-selective-instance-p object)
Description:
Returns t if the object is a selective instance, and nil otherwise.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - The object is a selective instance
nil - The object is not a selective instance

Function Index Top of Page

SD-INQ-OBJ-SHARED-OBJECTS  [function]

(sd-inq-obj-shared-objects object :all all)
Description:
Returns a list of all the objects that are shared by the given object. This list includes the given object.

Parameters:
object {SEL_ITEM} - The object to inquire
all {BOOLEAN}

Return Value:
shared-objects {LIST of SEL_ITEMs}
A list of all the items shared by the object, including the object itself.
list with only object in it - The specified object is not shared with any other objects

Function Index Top of Page

SD-INQ-CURR-PART  [function]

(sd-inq-curr-part)
Description:
Returns the current part object or nil if no part is current.

Parameters:
none.

Return Value:
curr-part {SEL_ITEM} - The current part object
nil - No part is current

Function Index Top of Page

SD-INQ-CURR-WP  [function]

(sd-inq-curr-wp)
Description:
Returns the current workplane object or nil if no workplane is current.
Please note that this function will return one of the following:

Parameters:
none.

Return Value:
curr-wp {SEL_ITEM} - The current workplane object
nil - No workplane is current

Function Index Top of Page

SD-INQ-CURR-WP-EXISTS-P  [function]

(sd-inq-curr-wp-exists-p)
Description:
Fast method to check whether a current workplane, docuplane or view exists.

Parameters:
none.

Return Value:
t - A current workplane, docuplane or view exists
nil - No workplane, docuplane or view is current

Function Index Top of Page

SD-INQ-PART-P  [function]

(sd-inq-part-p object)
Description:
Predicate to determine whether the passed object is a part.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is a part
nil - object is not a part

Function Index Top of Page

SD-INQ-ASSEMBLY-P  [function]

(sd-inq-assembly-p object)
Description:
Predicate to determine whether the passed object is an assembly.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is an assembly
nil - object is not an assembly

Function Index Top of Page

SD-INQ-CONTAINER-P  [function]

(sd-inq-container-p object)
Description:
Predicate to determine whether the passed object is a container.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is a container
nil - object is not a container

Function Index Top of Page

SD-INQ-STOCK-CONTAINER-P  [function]

(sd-inq-stock-container-p object)
Description:
Predicate to determine whether the passed object is a stock container.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is a stock container
nil - object is not a stock container

Function Index Top of Page

SD-INQ-WORKPLANE-P  [function]

(sd-inq-workplane-p object)
Description:
Predicate to determine whether the passed object is a workplane.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is a workplane
nil - object is not a workplane

Function Index Top of Page

SD-INQ-WPSET-P  [function]

(sd-inq-wpset-p object)
Description:
Predicate to determine whether the passed object is a workplane set.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is a workplane set
nil - object is not a workplane set

Function Index Top of Page

SD-INQ-FACE-PART-P  [function]

(sd-inq-face-part-p object)
Description:
Predicate to determine whether the passed object is a face part.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is a face part
nil - object is not a face part

Function Index Top of Page

SD-INQ-WIRE-PART-P  [function]

(sd-inq-wire-part-p object)
Description:
Predicate to determine whether the passed object is a wire part.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is a wire part
nil - object is not a wire part

Function Index Top of Page

SD-INQ-EMPTY-PART-P  [function]

(sd-inq-empty-part-p object)
Description:
Predicate to determine whether the passed object is an empty part. An empty part has no geometry.

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is an empty part
nil - object is not an empty part

Function Index Top of Page

SD-INQ-SIMPLIFIED-OBJECT-P  [function]

(sd-inq-simplified-object-p object)
Description:
Predicate to determine whether the contents of the passed object is a simplified object (red or yellow browser bullet)

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is a simplified object
nil - object is not a simplified object

Function Index Top of Page

SD-INQ-SIMPLIFICATION-OWNER-P  [function]

(sd-inq-simplification-owner-p object)
Description:
Predicate to determine whether the passed object is a simplified object and is the owner of the simplification definition according to that the object was simplified (red browser bullet)

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
t - object is the owner of the simplification definition
nil - object is not the owner of the simplification definition

Function Index Top of Page

SD-INQ-SIMPLIFICATION-NAME  [function]

(sd-inq-simplification-name object)
Description: Returns the name of the simplification definition according to which the object was simplified

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
name {STRING} - the name of the simplification
nil - object is not a simplified object

Function Index Top of Page

SD-INQ-SIMPLIFICATION-NAMES  [function]

(sd-inq-simplification-names object)
Description: Returns the name/names of all the simplification definitions attached to the object

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
names {LIST of STRINGs} - the name/names of the simplification definition attached
nil - object is not the owner of the simplification definition

Function Index Top of Page

SD-INQ-SIMPLIFICATION-OWNER-ID  [function]

(sd-inq-simplification-owner-id object)
Description: Returns the unique sysid of the owner of the simplification definition according to which the object was simplified

Parameters:
object {SEL_ITEM} - The object to inquire

Return Value:
name {STRING} - the unique sysid
nil - object is not a simplified object

Function Index Top of Page

SD-INQ-OBJ-CLIPPING-FLAG  [function]

(sd-inq-obj-clipping-flag object)
Description:
Returns the status of the object's clipping flag.

Parameters:
object {SEL_ITEM} - The object to inquire

Return value:
:on - if the cliping flag is set
:off - if the clipping flag is unset

See Also:
MODEL_CLIPPLANE [terminate action]
[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