User's Guide > Selection > Programmatic Selection
Programmatic Selection
Creo Object TOOLKIT C++ provides methods whereby you can make your own Selection objects, without prompting the user. These Selections are required as inputs to some methods and can also be used to highlight certain objects on the screen.
Methods Introduced:
The method pfcCreateModelItemSelection creates a selection out of any model item object. It takes a pfcModelItem and optionally a pfcComponentPath object to identify which component in an assembly the Selection Object belongs to.
The method pfcCreateComponentSelection creates a selection out of any component in an assembly. It takes a pfcComponentPath object. For more information about pfcComponentPath objects, see the section “Getting a Solid Object” in the Solid section.
Use the method pfcCreateModelSelection to create a pfcSelection object, based on a pfcModel object.
Some Creo Object TOOLKIT C++ methods require more information to be set in the selection object. The methods allow you to set the following:
The selected item using the method pfcSelection::SetSelItem.
The selected component path using the method pfcSelection::SetPath.
The selected UV parameters using the method pfcSelection::SetParams.
The selected T parameter (for a curve or edge), using the method pfcSelection::SetTParam.
The selected XYZ point using the method pfcSelection::SetPoint.
The selected table cell using the method pfcSelection::SetSelTableCell.
The selected drawing view using the method pfcSelection::SetSelView2D.
Was this helpful?