- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good idea, but possibly a bit unstable. Here is my attempt at doing that by code. The first 3 lines seem to work as planned, but the following lines were not working as planned. They seem to be getting odd (unexpected) data. But if I just run the rule with the first 3 lines, it seems to copy the right data to the Clipboard, then I can open a new, empty Microsoft Word document, and paste it in there, as planned. Not sure why the clipboard retrieval step is not working right. May be a timing related issue. It may need to process a while longer before trying to get the data from the clipboard or something. Might need to use a loop to wait a bit.
ThisApplication.CommandManager.ControlDefinitions.Item("AppiPropertiesWrapperCmd").Execute2(False)
System.Windows.Forms.SendKeys.SendWait("{RIGHT 6}{TAB 3}{ENTER}{TAB}{ENTER}{ESC}")
ThisApplication.UserInterfaceManager.DoEvents()
'Dim sMassPropsData As String = System.Windows.Forms.Clipboard.GetText(System.Windows.Forms.TextDataFormat.Rtf)
'Logger.Info(sMassPropsData)
'System.IO.File.WriteAllText("C:\Temp\MassProperties.txt", sMassPropsData, System.Text.Encoding.Unicode)
'Process.Start("notepad.exe", "C:\Temp\MassProperties.txt")
Edit: Oh, and by the way...if you use those first three lines on a document that does not have any model mass yet, the UPDATE button will not be available, so the sequence of 3 tabs would go straight to the CLIPBOARD button, instead of the UPDATE button.
Wesley Crihfield
(Not an Autodesk Employee)