- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have added some Vba code:
For a userform.
Private Sub UserForm_Activate() Dim a As Application Set a = ThisApplication Dim b As PartDocument Set b = a.ActiveDocument Dim Mass As MassProperties Set Mass = b.ComponentDefinition.MassProperties TextBox1.Text = Mass.Accuracy 'TextBox2.Text = Mass.AchievedAccuracy( TextBox3.Text = Mass.Area TextBox4.Text = Mass.AvailableAccuracy TextBox5.Text = Mass.CacheResultsOnCompute TextBox6.Text = Mass.CenterOfMass.X & " " & Mass.CenterOfMass.Y & " " & Mass.CenterOfMass.Z TextBox7.Text = Mass.IncludeCosmeticWelds 'TextBox8.Text = Mass.IncludeQuantityOverrides TextBox9.Text = Mass.Mass TextBox10.Text = Mass.MassOverridden 'TextBox11.Text = Mass.PrincipalMomentsOfInertial 'TextBox12.Text = Mass.RadiusOfGyration 'TextBox13.Text = Mass.RotationToPrincipal TextBox14.Text = Mass.Type TextBox15.Text = Mass.Volume TextBox16.Text = Mass.VolumeOverridden 'TextBox17.Text = Mass.XYZMomentsOfInertia 'LABELS Label1.Caption = "Mass.Accuracy" 'Label2.Caption = "Mass.AchievedAccuracy" Label3.Caption = "Mass.Area" Label4.Caption = "Mass.AvailableAccuracy" Label5.Caption = "Mass.CacheResultsOnCompute" Label6.Caption = "Mass.CenterOfMass" ' & " " & Mass.CenterOfMass.Y & " " & Mass.CenterOfMass.Z""" Label7.Caption = "Mass.IncludeCosmeticWelds" 'Label8.Caption = Mass.IncludeQuantityOverrides Label9.Caption = "Mass.Mass" Label10.Caption = "Mass.MassOverridden" 'Label11.Caption = Mass.PrincipalMomentsOfInertial 'Label12.Caption = Mass.RadiusOfGyration 'Label13.Caption = Mass.RotationToPrincipal Label14.Caption = "Mass.Type" Label15.Caption = "Mass.Volume" Label16.Caption = "Mass.VolumeOverridden" 'Label17.Caption = Mass.XYZMomentsOfInertia End Sub
I have added the Project for VBA too:
load this into your VBA environment.
Regards,
Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Dimension Component! | Partlist Export! | Derive I-properties! | Vault Prompts Via API! | Vault Handbook/Manual!
Drawing Toggle Sheets! | Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !