Skip to main content
6-Contributor
March 19, 2022
Solved

session. Select use help

  • March 19, 2022
  • 1 reply
  • 2052 views
Dear teacher:
I use JLINK development to activate the part in the component to select the surface, but only the activated component can be selected, and the surface features outside the activated component cannot be selected. Which teacher knows to help me, thank you.
 
SelectionOptions opts = pfcSelect.SelectionOptions_Create("sldedge,surface"); 
opts.SetMaxNumSels(new Integer(1));
Selections sels = session.Select(opts, null); 
Best answer by sjuraj

The method wfcSelect.wfcSelect.WSelectionOptions_Create allows you to set options for selecting objects by specifying the selection attribute. The input arguments are:
• OptionKeywords—Specifies the selection filter.
• MaxNumSels—Specifies the maximum number of selections.
• SelEnvOpts—Specifies the selection attribute set using the method wfcSelect.WSelectionOptions.SetSelEnvOptions.
The method wfcSelect.WSelectionOptions.GetSelEnvOptions retrieves the selection attribute.
The method wfcSelect.wfcSelect.SelectionEnvironmentOption_Create creates a data object of type SelectionEnvironmentOption that contains information about the attributes for the interactive selection in Creo Parametric user interface. Use the method wfcSelect.SelectionEnvironmentOption.SetAttribute to set the selection attribute. The following attribute types are available:
• SELECT_DONE_REQUIRED—Specifies that user has to click OK in the Select dialog box to get the selected items.
• SELECT_BY_MENU_ALLOWED—Specifies that search tool is available in the method pfcSession.BaseSession.Select when the attribute value is set to 1, which is the default value.
• SELECT_BY_BOX_ALLOWED—Specifies that user must draw a bounding box to get the items selected within the box.
• SELECT_ACTIVE_COMPONENT_IGNORE—Specifies that user can select items external to the activate component.
• SELECT_HIDE_SEL_DLG—Specifies that the Select dialog box must be hidden.
The method wfcSelect.SelectionEnvironmentOption.GetAttribute retrieves the selection attribute.
Use the method wfcSelect.SelectionEnvironmentOption.SetAttributeValue to get the integer value of the attributes set in the selection object.
The method wfcSelect.WSelection.Verify verifies if the content of the selection object is valid.
The method wfcSelect.WSelection.GetWindow retrieves the window where the selection was made.

1 reply

sjuraj15-MoonstoneAnswer
15-Moonstone
March 21, 2022

The method wfcSelect.wfcSelect.WSelectionOptions_Create allows you to set options for selecting objects by specifying the selection attribute. The input arguments are:
• OptionKeywords—Specifies the selection filter.
• MaxNumSels—Specifies the maximum number of selections.
• SelEnvOpts—Specifies the selection attribute set using the method wfcSelect.WSelectionOptions.SetSelEnvOptions.
The method wfcSelect.WSelectionOptions.GetSelEnvOptions retrieves the selection attribute.
The method wfcSelect.wfcSelect.SelectionEnvironmentOption_Create creates a data object of type SelectionEnvironmentOption that contains information about the attributes for the interactive selection in Creo Parametric user interface. Use the method wfcSelect.SelectionEnvironmentOption.SetAttribute to set the selection attribute. The following attribute types are available:
• SELECT_DONE_REQUIRED—Specifies that user has to click OK in the Select dialog box to get the selected items.
• SELECT_BY_MENU_ALLOWED—Specifies that search tool is available in the method pfcSession.BaseSession.Select when the attribute value is set to 1, which is the default value.
• SELECT_BY_BOX_ALLOWED—Specifies that user must draw a bounding box to get the items selected within the box.
• SELECT_ACTIVE_COMPONENT_IGNORE—Specifies that user can select items external to the activate component.
• SELECT_HIDE_SEL_DLG—Specifies that the Select dialog box must be hidden.
The method wfcSelect.SelectionEnvironmentOption.GetAttribute retrieves the selection attribute.
Use the method wfcSelect.SelectionEnvironmentOption.SetAttributeValue to get the integer value of the attributes set in the selection object.
The method wfcSelect.WSelection.Verify verifies if the content of the selection object is valid.
The method wfcSelect.WSelection.GetWindow retrieves the window where the selection was made.

15-Moonstone
March 21, 2022

So, SELECT_ACTIVE_COMPONENT_IGNORE would help you, but wfc package is paid one

DengXing6-ContributorAuthor
6-Contributor
March 21, 2022

Thank you very much for your answer.