Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Selection Loops

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
227 Views, 4 Replies

Selection Loops

I have three buttons

Button 1 starts a selection loop. When something is selected it is closed and button 2
gets selected automatically

Button 2 starts a selection loop. When something is selected it does something inside of
a transaction so it can be undone and redone.

Button 3 starts a loop that in itself starts a selection loop. Multiple picks are
processed individually.

At this point I want to be able to go through the buttons in order again.

Press button 1, and it automatically starts button one loop from button 3's do events
selection loop.

Press button 2, and it runs button 2's selection loop. When something is selected button
3's loops finish which causes the variable I set in button 2's selection to be lost

That isn't normally a problem, unless I use the transaction to undo the things that were
done with button 2's selection and put them back together with a different variable. It
fails because the variable set in the button 2 selection pick has been lost.

Between button 3 and Button 1 I need to kill the do loops that are active in button 3, but
can't seem to figure out how.

Or am I going about this all wrong?

PS If it sounds confusing here, you ought to see it in my code. LOL.

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Kent,

Wow! I can't imagine what you are attempting to do, and it seems like too
obvious of a question, but is the variable that is being lost a global
variable? One thing that you could try is to place a text box on the form
and load and unload the box. That way you can watch there results as the
different buttons are being pressed.

Hope this helps

EdT

"Kent Keller" wrote in message
news:CD1C84C771E1A4D26B898E6BC51BE61F@in.WebX.maYIadrTaRb...
> I have three buttons
>
> Button 1 starts a selection loop. When something is selected it is closed
and button 2
> gets selected automatically
>
> Button 2 starts a selection loop. When something is selected it does
something inside of
> a transaction so it can be undone and redone.
>
> Button 3 starts a loop that in itself starts a selection loop. Multiple
picks are
> processed individually.
>
> At this point I want to be able to go through the buttons in order again.
>
> Press button 1, and it automatically starts button one loop from button
3's do events
> selection loop.
>
> Press button 2, and it runs button 2's selection loop. When something is
selected button
> 3's loops finish which causes the variable I set in button 2's selection
to be lost
>
> That isn't normally a problem, unless I use the transaction to undo the
things that were
> done with button 2's selection and put them back together with a different
variable. It
> fails because the variable set in the button 2 selection pick has been
lost.
>
> Between button 3 and Button 1 I need to kill the do loops that are active
in button 3, but
> can't seem to figure out how.
>
> Or am I going about this all wrong?
>
> PS If it sounds confusing here, you ought to see it in my code. LOL.
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
>
Message 3 of 5
Anonymous
in reply to: Anonymous

I'm going to tag onto Kent's post here and ask if anyone has a very simple
example of how to *interactively* select multiple objects, sketches etc..
(with a filter) and then pass this collection to a sub for processing.

Kent has looked at my code and I think we are kind of on the same page.
Kent has gotten his to work further than mine but maybe there is a
straightforward example that will help up both...?

thread...>

--
Sean Dotson, PE
http://www.sdotson.com
Check the Inventor FAQ for most common questions
www.sdotson.com/faq.html
----------------------------------------------------------------------------
------
"Kent Keller" wrote in message
news:CD1C84C771E1A4D26B898E6BC51BE61F@in.WebX.maYIadrTaRb...
> I have three buttons
>
> Button 1 starts a selection loop. When something is selected it is closed
and button 2
> gets selected automatically
>
> Button 2 starts a selection loop. When something is selected it does
something inside of
> a transaction so it can be undone and redone.
>
> Button 3 starts a loop that in itself starts a selection loop. Multiple
picks are
> processed individually.
>
> At this point I want to be able to go through the buttons in order again.
>
> Press button 1, and it automatically starts button one loop from button
3's do events
> selection loop.
>
> Press button 2, and it runs button 2's selection loop. When something is
selected button
> 3's loops finish which causes the variable I set in button 2's selection
to be lost
>
> That isn't normally a problem, unless I use the transaction to undo the
things that were
> done with button 2's selection and put them back together with a different
variable. It
> fails because the variable set in the button 2 selection pick has been
lost.
>
> Between button 3 and Button 1 I need to kill the do loops that are active
in button 3, but
> can't seem to figure out how.
>
> Or am I going about this all wrong?
>
> PS If it sounds confusing here, you ought to see it in my code. LOL.
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
>
Message 4 of 5
Anonymous
in reply to: Anonymous

Sean

I kind of figured you would tack on 8^) I was going to ask about yours also, but figured
you could do it if you wanted.

The basic question is .... is there any way to kill a selection loop (the standard
clsSelect class module) before a new selection loop is started without resorting to a
button or something that does nothing but kill it.


Ed

Thanks for the response. Yes it is a global variable. Wish it was that simple. (It
probably is that simple but I am just to dense to see the answer)



--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Sean Dotson" wrote in message

> > thread...>
Message 5 of 5
Anonymous
in reply to: Anonymous

Ohhh, I think that I see what the question is...:-)

This "continuous" loop issue is kind of a classic problem. Similar
questions came up in ACAD on a number of occasions. If a command was ran
one time, (if it were a copy, move, select or whatever) the operator would
have to keep reinitiating the command. The alternative was for the command
to keep recycling through. But, then the operator had to make some action
that would stop the operation. ACAD essentially provided the option to do a
single command or to perform it multiple times, which is essentially two
different commands. But, when the multiple command was selected, a third
"button" was require to exit the operation. "Escape", "Right mouse click",
or a button is probably going to be needed to stop they "multiple"
selections.

I hope this is what the real question is.

EdT


"Kent Keller" wrote in message
news:1CF32041BC77E4FFEA3055B55043FFAB@in.WebX.maYIadrTaRb...
> Sean
>
> I kind of figured you would tack on 8^) I was going to ask about yours
also, but figured
> you could do it if you wanted.
>
> The basic question is .... is there any way to kill a selection loop (the
standard
> clsSelect class module) before a new selection loop is started without
resorting to a
> button or something that does nothing but kill it.
>
>
> Ed
>
> Thanks for the response. Yes it is a global variable. Wish it was that
simple. (It
> probably is that simple but I am just to dense to see the answer)
>
>
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
> "Sean Dotson" wrote in message
>
> > your
> > thread...>
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report