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

Topologial Inquiries

GET_SELECTION  [interrupt action]

                     |                                           |
-->(GET_SELECTION)-->+-->(:FOCUS_TYPE)-+->{focus type}---------->+
                     |                 |                         |
                     |                 +->{focus type list}----->+
                     |                                           |
                     |                                           |
                     |                                           |
                     |                                           |
                     |                                           |
                     |                                           |
                     +-->(:ALLOW_GRAPHICS_ONLY)->{keyword list}->+
                     |                                           |
                     |                                           |
                     |                                           |
                     |                                           |
                     +-->(:CHECK_FUNCTION)-->|Lisp function|---->+
                     +----->(:SELECT)-->|select subaction|--------------->
GET_SELECTION invokes the standard Creo Elements/Direct Modeling SELECT subaction and returns a list of the selected item(s) which satisfy the passed focus type.

Note: This interrupt action should only be used programmatically via sd-call-cmds as a way to inquire topological information from the system.

:focus_type {FOCUS_TYPE or LIST of FOCUS_TYPES ["all"]}
specifies what kinds of items are allowed to be selected.
focus_type or each element of the list of focus types must be one of the symbols shown in the table below:

FOCUS_TYPE will select:
Base Types:
*sd-assembly-seltype* Assembly (and Container)
*sd-container-seltype* Container
*sd-part-seltype* Part
*sd-layout-seltype* Layout
*sd-view-seltype* Layout View
*sd-docuplane-set-seltype* Docuplane Set
*sd-docuplane-seltype* Docuplane
*sd-wpset-seltype* Workplane Set
*sd-workplane-seltype* Workplane
*sd-coord-sys-object-seltype* Coordinate System
*sd-vertex-2d-seltype* 2D Vertex
*sd-match-vertex-2d-seltype* 2D Match Vertex
*sd-edge-2d-seltype* any 2D Geometry
*sd-c-edge-2d-seltype* any 2D Construction Geometry
*sd-c-vertex-2d-seltype* 2D Construction Point
*sd-line-2d-seltype* 2D straight Line
*sd-c-line-2d-seltype* 2D straight Construction Line
*sd-c-finite-line-2d-seltype* 2D straight finite Construction Line
*sd-circle-2d-seltype* 2D Circle
*sd-arc-2d-seltype* 2D Arc
*sd-fillet-2d-seltype* 2D Fillet
*sd-c-circle-2d-seltype* 2D Construction Circle
*sd-c-arc-2d-seltype* 2D Construction Arc
*sd-c-fillet-2d-seltype* 2D Construction Fillet
*sd-spline-2d-seltype* 2D Spline
*sd-c-spline-2d-seltype* 2D Construction Spline
*sd-control-point-seltype* Control Point of a CSpline
*sd-interpolation-point-seltype* Interpolation Point of an ISpline
*sd-vertex-3d-seltype* 3D Vertex
*sd-edge-3d-seltype* any 3D Edge
*sd-line-3d-seltype* 3D straight Edge
*sd-circle-3d-seltype* 3D Circle
*sd-arc-3d-seltype* 3D Arc
*sd-spline-3d-seltype* 3D Spline
*sd-face-seltype* any Face
*sd-spline-face-seltype* Spline Face
*sd-plane-seltype* Planar Face
*sd-sphere-seltype* Spherical Face
*sd-cone-seltype* Conical Face
*sd-torus-seltype* Torodial Face
*sd-cylinder-seltype* Cylindrical Face
*sd-blend-3d-seltype* 3D Blend Face
*sd-chamfer-3d-seltype* 3D Chamfer Face
*sd-spun-spline-face-seltype* Spun Spline Face
*sd-par-spline-face-seltype* Parallel swept Spline Face
*sd-coord-sys-plane-seltype* Coordinate System Plane
*sd-coord-sys-axis-seltype* Coordinate System Axis
*sd-coord-sys-origin-seltype* Coordinate System Origin
*sd-label-seltype* any Label
*sd-rel-label-seltype* Relation Label
*sd-feat-label-seltype* Feature Label
*sd-3d-anno-label-seltype* 3D Annotation Label
*sd-relation-seltype* Relation
*sd-relation-set-seltype* Relation Set
*sd-rel-dis-seltype* Distance Relation
*sd-rel-ang-seltype* Angle Relation
*sd-rel-rad-seltype* Radius Relation
*sd-rel-dia-seltype* Diameter Relation
*sd-rel-par-seltype* Parallel Relation
*sd-rel-prp-seltype* Perpendicular Relation
*sd-rel-coi-seltype* Coincident Relation
*sd-rel-tan-seltype* Tangent Relation
*sd-rel-sym-seltype* Symmetry Relation
*sd-rel-fxd-seltype* Fixed Relation
*sd-rel-rgd-seltype* Rigid Relation
*sd-rel-vdis-seltype* Distance Variable
*sd-rel-vang-seltype* Angle Variable
*sd-rel-vnum-seltype* Number Variable
*sd-rel-vlog-seltype* Logical Variable
*sd-rel-vchk-seltype* Check Variable
*sd-rel-mdis-seltype* Measure Distance Relation
*sd-rel-mang-seltype* Measure Angle Relation
*sd-rel-mlen-seltype* Measure Length Relation
*sd-rel-mrad-seltype* Measure Radius Relation
*sd-rel-gear-seltype* Gear Relation
*sd-rel-rack-seltype* Rack Relation
*sd-rel-screw-seltype* Screw Relation
*sd-rel-cam-seltype* Cam Relation
*sd-anim-animation-seltype* Animation
*sd-3d-annotation-seltype* 3D Annotation
*sd-3d-anno-dis-seltype* 3D Distance Annotation
*sd-3d-anno-ang-seltype* 3D Angle Annotation
*sd-3d-anno-rad-seltype* 3D Radius Annotation
*sd-3d-anno-dia-seltype* 3D Diameter Annotation
*sd-3d-anno-coord-seltype* 3D Coordinate Annotation
*sd-3d-anno-baseline-seltype* 3D Baseline Annotation
*sd-3d-anno-symbol-seltype* All kind of Symbol Annotations
*sd-3d-anno-gdt-symbol-seltype* GD&T Symbol Annotation
*sd-3d-anno-surface-symbol-seltype* Surface Symbol Annotation
*sd-3d-anno-welding-symbol-seltype* Welding Symbol Annotation
*sd-3d-anno-user-symbol-seltype* User-defined Symbol Annotation
*sd-3d-anno-text-seltype* 3D Text Annotation
*sd-docu-group-seltype* 3D Documentation Group
*sd-configuration-seltype* Configuration
*sd-matchline-seltype* Matchline
*sd-feature-seltype* any Feature
*sd-custom-feature-seltype* Custom Feature
Composed Types:
*sd-c-geom-2d-seltype* 2D Construction Geometry and Vertices
*sd-geom-2d-seltype* 2D Geometry and Vertices
*sd-all-geom-2d-seltype* 2D Real and Construction Geometry,
Vertices and Construction Points
*sd-geom-3d-seltype* 3D Vertices, Edges and Faces
*sd-part-wp-seltype* Part, Workplane
*sd-3d-object-seltype* Assembly, Part, Workplane Set, Workplane
Layout, View, Docuplane Set, Docuplane,
Coordinate System Object
*sd-coord-sys-elem-seltype* Coordinate System Elements (Plane, Axis and Origin)
*sd-layout-view-seltype* Layout, View

Note: Non construction geometry types select real geometry only.

Note: The select focus types for Annotation objects are listed in the Annotation select documentation.

If you pass this parameter, the selection will be restricted on single elements only. The default is to allow multiple selection.
when selecting 2d geometry (e.g. :focus_type = *sd-edge-2d-seltype*), only items belonging to the current workplane may be selected. The default is to allow selection on any workplane.
when selecting 3d geometry (e.g. :focus_type = s_edge_3d), only items belonging to the current part may be selected. The default is to allow selection in any part.
when selecting a part, allow a face part to be selected. The default is to not allow face parts.
when selecting a part, allow a wire part to be selected. The default is to not allow wire parts.
when selecting a part or assembly, allow a lightweight object be selected. The default is to not allow lightweight objects.
Possible values are:
  nil                   ;default
  (list :part)
  (list :assembly)
  (list :part :assembly)
when selecting an assembly, allow a stock container to be selected. The default is to not allow stock container.
when selecting a lightweight part or 3D element allow to automatically reload the item or not. The default is to allow automatic reload of lightweight items.
the selected entities and objects will not be highlighted. The default is to highlight the selected entities and objects.
:check_function {LISP function}
specifies a Lisp function to use to verify whether or not selected items are valid. This function must take as input a sel_item structure. It must return :ok if the item is acceptable, or, if the item is not acceptable, then it must return either :filter to silently remove the item from the selection list or :error to halt the selection and return no selection values.
:select {any valid SELECT parameters}
after all other options have been specified, this option invokes the select subaction. At this point you can pass any number of valid SELECT options.

Return Value:
item {SEL_ITEM}
if single_selection was set and an object was successfully selected.
items {LIST of SEL_ITEMs}
if the parameter single_selection was not given and one or more objects were successfully selected.
nil - if no objects were selected


Select all top-level parts in the system, including wire and face parts:

   (sd-call-cmds (get_selection :focus_type *sd-part-seltype*
Select all parts in a specific assembly:
   (sd-call-cmds (get_selection :focus_type *sd-part-seltype*
                                :in_assembly assembly-sel-item))
Select all edges of the current part:
   (sd-call-cmds (get_selection :focus_type *sd-edge-3d-seltype*

   (sd-call-cmds (get_selection :focus_type *sd-edge-3d-seltype*
Select all circular edges of a specific part:
   (sd-call-cmds (get_selection :focus_type *sd-circle-3d-seltype*
                                :selected_part part-sel-item
Select all planar faces of a specific part:
   (sd-call-cmds (get_selection :focus_type *sd-plane-seltype*
                                :selected_part part-sel-item
Select a list of all faces of a part that have a transparency setting greater than 0.5:
  (defun check-transparent-face (face)
    (let ((ft (sd-inq-face-transparency face)))
      (if (and ft (>= ft 0.5))

  (sd-call-cmds (get_selection :focus_type *sd-face-seltype*
                               :check_function #'check-transparent-face
                               :selected_part part-sel-item

Function Index Top of Page


(sd-get-faces-along-ray part ray-point ray-direction
                        :include-details  include-details-flag
                        :in-dir-only      in-dir-only-flag)
Returns all faces of the specified part which were hit by the specified ray. The return list is ordered by distance from the ray point.

part {SEL_ITEM} - the part through which the ray is fired
ray-point {gpnt3d} - a global 3D point on the ray
ray-direction {gpnt3d} - the direction of the ray
:include-details {BOOLEAN [t]}
If this parameter is given, the result list contains for each hit face the hit point on the face (in global coordinates) and the distance of the hit point to the passed ray point.
:in-dir-only {BOOLEAN [t]}
If given, only faces which were hit in the given ray direction are returned. If this parameter is nil, all faces along the ray in both directions from the ray point are collected.

Return Value:
list of faces (and details) {LIST}
In case :include-details was set to nil, a plain list of hit face sel_items is returned.
If :include-details was set to t, each entry of the result list consists of the following items:
  1. face sel_item
  2. coordinate of the hit point on the hit face in global coordinates
  3. distance of the hit point to the passed ray point
nil - no faces hit or other failure

(sd-get-faces-along-ray a-part-sel-item
 => ((face1-sel-item -7.3395950607527531,54.302977610797249,159.56341882702216 42)
     (face2-sel-item -32.708551550065003,39.938131591119159,189.79696386352623 0))

(sd-get-faces-along-ray a-part-sel-item
     :include-details nil)
 => (face1-sel-item face2-sel-item)

[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