- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys,
I was looking for an information to automate section view for the assembly and to be honest I stuck here:
ThisApplication.ActiveDocument.SelectSet.Select(assm.ComponentDefinition.WorkPlanes.Item("XY Plane")) ThisApplication.CommandManager.ControlDefinitions.Item("AssemblyHalfSectionViewCmd").Execute
now the window pops up and I need to hit ok button:
I found some information to use
SendKeys
to close the window resulting with execution but apparently it is no longer supported.
Can anyone help me with this? Isn't it possible any longer?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
It is still supported see send key string
SendKeys.SendWait("ENTER")
It is a little tricky to control these commands as you are effectively sending the inputs after the dialogue has opened so it can get mixed results.
Or if this helped you, please, click (like)
Regards
Alan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @jpi656UL. Also when using SendKeys, you have to make sure that the dialog you want to send the keystrokes to has 'system focus' when they are 'sent out', because the keystrokes could get sent to the wrong place, which is why it is dangerous. I often precede the SendKeys line with AppActivate(ThisApplication.Caption), but even that if fairly vague. There is also a more advanced vb.net function usually called "SetForegroundWindow" that you could use there, if you were proficient in your vb.net. Then use "ThisApplication.UserInterfaceManager.DoEvents" on the line after calling SendKeys, to force it to be processed right then.
Or, you might be able to skip using the SendKeys altogether, and execute another command. There are several that sound about right, such as "AppContextual_DoneCmd", "AppContextual_ApplyCmd", "AppContextual_OKCmd", "AppContextual_ContinueCmd", "AppContinueCmd", "Continue", "Done", etc.
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report