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: 

Disabling the spacebar "repeat last command" function

8 REPLIES 8
Reply
Message 1 of 9
tclayton
2701 Views, 8 Replies

Disabling the spacebar "repeat last command" function

Since Inventor 2010, the spacebar has the functionality of repeating the last command. We have an add-in that requires typing  a short phrase. (You can see where this is headed) 

Whenever you use the spacebar to seperate the words in the phrase, a new addin form opens in front of the old one.

 

This add-in is employing the WordWrapper code that Brian submitted some time ago to clear up a similiar issue when you used the Enter key, but the spacebar problem persists

 

Is there a way to disable this funtion? Or work around it?

8 REPLIES 8
Message 2 of 9
IvDev1
in reply to: tclayton

Hi tclayton,

 

Did you find out solution for this problem?

I am having similar problem with my addin in Inventor 2012.

Please suggest if you found a way to disable repeat last command option.

Message 3 of 9
tclayton
in reply to: IvDev1

Sadly, no.

Message 4 of 9
Ralf_Krieg
in reply to: tclayton

Hello

 

I'm not sure, but have you tried to disable userinteraction in Inventor while your form is open? If userinteraction is diabled, Inventor shouldn't react on anything the user do (mouseclick, shortcuts and hopefully spacebar).

 

myInventor.UserInterfaceManager.UserInteractionDisabled = True

 Be sure to enable Interaction on every possible way your user close the form or your Inventor looks like a screenshot. Smiley Wink


R. Krieg
RKW Solutions GmbH
www.rkw-solutions.com
Message 5 of 9
IvDev1
in reply to: Ralf_Krieg

Hi krieq

 

Thank you for your suggestion. I did try disabling the user intervention but the problem is if I diable user intervenation user is not able to type in the text for renaming the tree node. My requirement is allow user to enter node name with spaces and disable the last repeat command dialog to open. I thought there should be an option to remove these short cut keys but I could not find any in "Tools -- Cutomize" I could not find one.

 

The repeat last command internal command name is "AppRepeatCmd" I also tried getting the control defination (ControlDefinition) for this command and set the disable flag to true and I can see that in the contextual menu repeat last command is disabled but when I hit space/enter key it still opens the command dialog, so no luck.

 

Any other suggestions on hot to supress the event which triggers last executed command?

Message 6 of 9
adam.nagy
in reply to: IvDev1

Hi there,

 

Are you using a modeless dialog? That's where the user is trying to enter a text that includes a space?

 

What about using a modal dialog instead?

 

Also, you could try setting Inventor as the parent of your modeless window:

<code>

#Region "hWnd Wrapper Class" 
' This class is used to wrap a Win32 hWnd as a .Net IWind32Window class. 
' This is primarily used for parenting a dialog to the Inventor window. 

' For example: 
' myForm.Show(New WindowWrapper(m_inventorApplication.MainFrameHWND)) 

Public Class WindowWrapper 
Implements System.Windows.Forms.IWin32Window 

Public Sub New(ByVal handle As IntPtr) 
_hwnd = handle 
End Sub 

Public ReadOnly Property Handle() As IntPtr _ 
Implements System.Windows.Forms.IWin32Window.Handle 
Get 
Return _hwnd 
End Get 
End Property 

Private _hwnd As IntPtr 
End Class 
#End Region 

</code>

 

I hope this helps.

 

______________________________________________________________

If my post answers your question, please click the "Accept as Solution"

button. This helps everyone find answers more quickly!



Adam Nagy
Autodesk Platform Services
Message 7 of 9
IvDev1
in reply to: adam.nagy

Hi Adam,

 

Thank you for reply. Actually I am not using any dialog, This is rename command where user right mouse click on tree node and click on rename and enter the name for node. While entering the name for node if user hit space last command dialog appears.

 

I was able to avoid the problem temporarily by InteractionEventsObject::Start() before starting rename command and InteractionEventsObject::Stop() once rename operation is complete. This is not an ideal solution because when I do this after entering the name if user hit the 'Enter' key it does not complete the rename operation.

I mean user has to click on some where in graphics screen to complete the rename operation.

 

 

 

Message 8 of 9
adam.nagy
in reply to: tclayton

Hi,

 

Which Inventor version are you using? OS version?

Could you please provide the exact steps to reproduce the problem?

 

I checked in Inventor 2011 and when I selected a part occurrence in the browser tree and then clicked on it again to change the name, the space bar did not start the last command. If I clicked in the drawing area and then pressed space bar then the last command got repeated.

 



Adam Nagy
Autodesk Platform Services
Message 9 of 9
Jusdoo
in reply to: adam.nagy

Thank you very much, Adam, Legend! It works. I was so frustrated.

I have been keeping the CLASS in the code, but never used until have the same problem as Tclayton's. 

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

Post to forums  

Autodesk Design & Make Report