×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Macro User Selection Issue

Macro User Selection Issue

Macro User Selection Issue

(OP)
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.

RE: Macro User Selection Issue

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

CATIA.ActiveDocument.Selection.clear

Thank you anyway!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources