Select by mouse

Hello alltogether,

i have written a little tool, that makes some changes to existing holes and adds additional holes at the top and them bottom end of this hole. Sometimes the tool runs into a problem to detect the face at the bottom end of the hole. In this situations i would like to let the user select a plane face or a refplane.

I reviewed several solutions and posts, but i can't get to a working solution. At the moment, I have my LocateFilters and my locate mode.

What i would like to do:

In the MouseDown Event of my SelectPlane Class i will check if the user has selected a valid plane via the normal of the plane. If it is a valid plane return this plane. If not show a message and give the user another try (lets say 5 times).

What i am missing:

How can i make my main programm wait till the user has selected a valid plane face or refplane, return that face or refplane and the continiue with the main programm?

How can i terminate the command, if the user selected a valid plane?

Must i use an other thread to let the user select the plane?

A push in the right direction would be very helpful.


Greetings from Germany
Christian Kunkel

Re: Select by mouse

Have you taken a look at my MouseEvents sample on GitHub? Not sure if it has all of your answers but it should provide a basic understanding of what you're trying to accomplish. I can fill in any remaining gaps if you still have questions.

Jason Newell
Applications Architect

Re: Select by mouse

[ Edited ]

Hello Jason,

thanks for your reply. I have already looked at your sample, this is always one of my first approaches. Your sample helped me to find out, which seLocateFilters i must use for my case and which LocateMode works best for me.

I will also have no problem to adjust your "LogEvent" Sub for my needs.

What i want to do is the following:

Create a class with a function, that will let the user select a face, and return that face to my main programm.

At the moment, my problem is:

  • How to make my main program "wait" till the user selected a valid face?


Greetings from Germany
Christian Kunkel