Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

There may be a timing issue around when that dialog shows, and when the code sends the keystrokes to it.  Or it may simply not be setting the focus to that dialog correctly.  You will have to test interacting with that dialog completely by manual keyboard interaction, while recording exactly what you had to do on the keyboard.  Then try to simulate those actions in the SendWait method.  You can also try that other method for ensuring system focus is in the right place.  It may take some trial & error testing to get it right on your system.

Below is a different example code I had which manipulates the iProperties dialog using the SendKeys.SendWait method, and that other SetForegroundWindow method I mentioned.  It will automatically navigate to the Physical tab for you.  At least that's how it works for me.  You might also need to include that DoEvents line in your solution, because I forgot about that one in the last responce.

Imports System.Windows.Forms
Imports System.Runtime.InteropServices
Sub Main
	ThisApplication.CommandManager.ControlDefinitions.Item("AppiPropertiesWrapperCmd").Execute2(False)
	SetForegroundWindow(ThisApplication.MainFrameHWND)
	'System.Windows.Forms.Form.ActiveForm.Handle
	System.Windows.Forms.SendKeys.SendWait("{RIGHT 6}")
	ThisApplication.UserInterfaceManager.DoEvents()
End Sub

<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function SetForegroundWindow(hWnd As IntPtr) As Integer
End Function

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)