Inventor Customization

Inventor Customization

Reply
Active Contributor
tclayton
Posts: 26
Registered: ‎10-10-2009
Message 1 of 8 (788 Views)

Disabling the spacebar "repeat last command" function

788 Views, 7 Replies
07-17-2010 06:24 AM

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?

Member
IvDev1
Posts: 4
Registered: ‎07-20-2012
Message 2 of 8 (589 Views)

Re: Disabling the spacebar "repeat last command" function

07-20-2012 05:33 PM 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.

Active Contributor
tclayton
Posts: 26
Registered: ‎10-10-2009
Message 3 of 8 (582 Views)

Re: Disabling the spacebar "repeat last command" function

07-22-2012 11:54 AM in reply to: IvDev1

Sadly, no.

Mentor
krieg
Posts: 176
Registered: ‎11-22-2009
Message 4 of 8 (564 Views)

Re: Disabling the spacebar "repeat last command" function

07-24-2012 12:51 PM 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. :smileywink:

Member
IvDev1
Posts: 4
Registered: ‎07-20-2012
Message 5 of 8 (557 Views)

Re: Disabling the spacebar "repeat last command" function

07-24-2012 05:21 PM in reply to: 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?

ADN Support Specialist
adam.nagy
Posts: 567
Registered: ‎03-26-2007
Message 6 of 8 (532 Views)

Re: Disabling the spacebar "repeat last command" function

08-08-2012 09:57 AM 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
Developer Technical Services
Autodesk Developer Network
Member
IvDev1
Posts: 4
Registered: ‎07-20-2012
Message 7 of 8 (529 Views)

Re: Disabling the spacebar "repeat last command" function

08-08-2012 10:25 AM 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::smileyfrustrated:tart() before starting rename command and InteractionEventsObject::smileyfrustrated:top() 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.

 

 

 

ADN Support Specialist
adam.nagy
Posts: 567
Registered: ‎03-26-2007
Message 8 of 8 (517 Views)

Re: Disabling the spacebar "repeat last command" function

08-15-2012 06:53 AM 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
Developer Technical Services
Autodesk Developer Network
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.