Places the engineering environment into a "Waiting for User Selections State" and script is on hold until the user has made the selections and committed them.
An object is returned that describes the selections.
Parameters
Types (string) - a comma delimited list of the types of selectable objects the user can pick. The full list is below.
MinNoSelections (integer) - the limit of the minimum number of selections the user needs to set. -1 represents any number allowed (including zero). An error is raised when the user does nto select the minimum number of selections to prevent script from continuing.
MaxNoSelections (integer) - the limit of items the user can select. -1 represents any number of selections.
Return Value
A "Selections" object (documented under the CAD object).
Due to the complex nature of the returned data a custom object holds the results and allows for actions to be performed.
Remarks
The list of allowed types are as follows (from PTC documentation)
Items in Bold are the Strings to use.
Creo Parametric Database Item | String Identifier | PTC Model Item Type |
Datum point | point | EpfcITEM_POINT |
Datum axis | axis | EpfcITEM_AXIS |
Datum plane | datum | EpfcITEM_SURFACE |
Coordinate system datum | csys | EpfcITEM_COORD_SYS |
Feature | feature | EpfcITEM_FEATURE |
Edge (solid or datum surface) | edge | EpfcITEM_EDGE |
Edge (solid only) | sldedge | EpfcITEM_EDGE |
Edge (datum surface only) | qltedge | EpfcITEM_EDGE |
Datum curve | curve | EpfcITEM_CURVE |
Composite curve | comp_crv | EpfcITEM_CURVE |
Surface (solid or quilt) | surface | EpfcITEM_SURFACE |
Surface (solid) | sldface | EpfcITEM_SURFACE |
Surface (datum surface) | qltface | EpfcITEM_SURFACE |
Quilt | dtmqlt | EpfcITEM_QUILT |
Dimension | dimension | EpfcITEM_DIMENSION |
Reference dimension | ref_dim | EpfcITEM_REF_DIMENSION |
Integer parameter | ipar | EpfcITEM_DIMENSION |
Part | part | N/A |
Part or subassembly | prt_or_asm | N/A |
Assembly component model | component | N/A |
Component or feature | membfeat | EpfcITEM_FEATURE |
Detail symbol | dtl_symbol | EpfcITEM_DTL_SYM_INSTANCE |
Note | any_note | EpfcITEM_NOTE, EpfcITEM_DTL_NOTE |
Draft entity | draft_ent | EpfcITEM_DTL_ENTITY |
Table | dwg_table | EpfcITEM_TABLE |
Table cell | table_cell | EpfcITEM_TABLE |
Drawing view | dwg_view | N/A |
Examples
Get a selection of exactly 2 Edges or Surfaces
Dim Sels as Selections = CAD.PromptForSelections("edge,surface", 2, 2)