Checked in both model and drawing mode and I've no issues with this macro. Also I've omitted the esc key line and it worked great.
I would agree, it does work - and no side effects. But then it acts up, then not - seems intermittent. Turn caplocks on, it turns it off - or not. Hit esc, and smart dim, then macro, shuts them off - or not. Hmm.
Don't use SendKeys. SendKeys is a last resort for programs that don't have an API.
I do have a mouse gesture set up for smart dimension. A hot key also. Neither however seem to disable the preselect.
"swModel.ClearSelection2 True" works. Thank you.
'to circumvent smart dimension preselect
'clear selection, smart dimension
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swModelDocExt As SldWorks.ModelDocExtension
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swModelDocExt = swModel.Extension
swModelDocExt.RunCommand swCommands_SmartDimension, ""