Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro User Selection Issue

Status
Not open for further replies.

Travois

Automotive
Jul 8, 2014
2
US
Hi everybody I am new to the forum and i was wondering if any of you guys may have some experience in an issue that has been bothering me for quite some time.

Im working on a Macro that does some afterwork on some User's Selected surfaces, it works just fine on the first run, but when i try to cycle it with a For it does not ask me again to select the surfaces. The code in question is this:

Dim CONT1 As integer
For CONT1 = 1 to Total

Dim oSelectionFilter
sMessage = "Select the surfaces to extract for " & hybridBody3.Name
reDim oSelectionFilter(1)
oSelectionFilter(0) = "TriDim"
oSelectionFilter(1) = "Face"
CATIA.ActiveDocument.Selection.SelectElement3 oSelectionFilter, sMessage, True, CATMultiSelTriggWhenUserValidatesSelection, True

Set cInputs (CONT1)= New Col
cInputs(CONT1).Add CATIA.ActiveDocument.Selection.Item(i).Value


Then it stops and ask me for the Selection.

But when the CONT1 hits 2 it reDos it with the geometry selected for Its Value at 1

Does somebody knows how can i Retrigger the selection?

Thanks in advance.
 
Replies continue below

Recommended for you

I have just Found the answer, you have to clean the selection before each cycle.

CATIA.ActiveDocument.Selection.clear

Thank you anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top