Author Topic: Rotate Jig while placing block with jig  (Read 2129 times)

0 Members and 1 Guest are viewing this topic.

JohanMagnusson

  • Guest
Rotate Jig while placing block with jig
« on: February 08, 2010, 03:00:55 PM »
Hi everyone.

I'm trying to figure out how to enable the user to rotate the jig/block during insertion.
I want the user to be able to rotate the jig/block with 90 degrees each time user presses spacebar.

I have made some methods so that i can place a block with a jig, and all that works great.

Only place where i can think of geeting the spacebar input is in the overridden Sampler(JigPrompts prompts) method. If i set UserInputControls.NullResponseAccepted then i can get a PromptStatus.None form the prompt that's being returned when spacebar is pressed. But i don't get a insertion point so it messes things up...

When i do this the jig disappears from the screen and the comman gets messed up.

I'm totally lost, need some help, hints, anything that can get me on track to a solution.


vegbruiser

  • Guest
Re: Rotate Jig while placing block with jig
« Reply #1 on: February 08, 2010, 03:37:52 PM »
Why force the user to use the spacebar at all? Couldn't you simply have the 4 options as a set of PromptKeyWordOptions:

Code: [Select]
prko = new PromptKeywordOptions("\nWhat angle would you like?");
prko.Keywords.Add("0");
prko.Keywords.Add("90");
prko.Keywords.Add("180");
prko.Keywords.Add("270");
prko.Keywords.Default = "0";
PromptResult getWhichFloorResult = ed.GetKeywords(prko);

:)

JohanMagnusson

  • Guest
Re: Rotate Jig while placing block with jig
« Reply #2 on: February 08, 2010, 04:02:41 PM »
Why force the user to use the spacebar at all? Couldn't you simply have the 4 options as a set of PromptKeyWordOptions:

Code: [Select]
prko = new PromptKeywordOptions("\nWhat angle would you like?");
prko.Keywords.Add("0");
prko.Keywords.Add("90");
prko.Keywords.Add("180");
prko.Keywords.Add("270");
prko.Keywords.Default = "0";
PromptResult getWhichFloorResult = ed.GetKeywords(prko);

:)

Trying to avoid that, want to eliminate all typing.
The command is for mass deployment of a specific block, so using only one key to rotate with is much faster than typing the degree every time.


Bryco

  • Water Moccasin
  • Posts: 1883
Re: Rotate Jig while placing block with jig
« Reply #3 on: February 08, 2010, 05:47:48 PM »
If the user is only allowed to insert the block with rotations of 0,90,180 & 270 you make your rotate jig only react to 90 deg intervals and Bob's your uncle