- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I agree. I had also tried to find the command behind that button before, but was not able to. We do know the command behind the UPDATE button ("AppUpdateMassPropertiesCmd"), but not the Clipboard button. That command does not appear to have been exposed to the iLogic or Inventor API system yet either. However, we do have access to pretty much all the same data through the Inventor API system, so could most likely replicate what that button does by code. Writing the code for that task would be a real pain though, and would likely require quite a lot of code. We have access to most of the data you see on that Physical Properties tab through the MassProperties API object. And we can get access to that MassProperties object within the ComponentDefinition of PartDocuments (PartComponentDefinition.MassProperties), AssemblyDocuments (AssemblyComponentDefinition.MassProperties), and through assembly components (ComponentOccurrence.MassProperties), and a few other specialty types. Once you have a reference to that MassProperties object assigned to a variable within your code, you can begin extracting all the data you require from it, using its various Methods & Properties. But keep in mind that the data you get from those methods & properties will be in 'database units' instead of 'document units' (if they are different). So, you may need to convert the units of the values as needed, to see the values in the units you want. Then as you are extracting the data you want, you can build a large String (text) that contains textual sentences which include the data, and format it as you would like to see it, similar to what you see when you paste that copied data into a Microsoft Word document.
The steps of copying the data to the system clipboard, and/or retrieving that data from the Clipboard, is likely the simplest steps of the whole process. Below is an extremely simple example of pasting text type data to the Clipboard, then retrieving it again, then showing the retrieved data in a MessageBox. You may notice that it does not try to correct my use of a capital E in the word Copied.
Clipboard.SetText("Text 2 B CopiEd!", TextDataFormat.Rtf)
sCopiedText = Clipboard.GetText(TextDataFormat.Rtf)
MessageBox.Show("The following text was copied to the Clipboard: " _
& vbCrLf & sCopiedText, "Retrieved From System Clipboard")
I am specifying RTF format, because that is the specific format being used by the Clipboard button in the Physical Properties tab. Here is a link to the online help page which mentions that.
https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-877564AC-78CE-4216-9913-003A2DE8D698
Wesley Crihfield
(Not an Autodesk Employee)