iProperties Dialog Box - Display "Physical" Tab Using a VBA Macro

iProperties Dialog Box - Display "Physical" Tab Using a VBA Macro

isocam
Collaborator Collaborator
793 Views
8 Replies
Message 1 of 9

iProperties Dialog Box - Display "Physical" Tab Using a VBA Macro

isocam
Collaborator
Collaborator

Can  anybody help?

 

I have the following line of code in a VBA macro to display the iProperties dialog box

 

ThisApplication.CommandManager.ControlDefinitions.Item("AppiPropertiesWrapperCmd").Execute

 

Is it possible to open the iProperties dialog box and automatically show the "Physical" Tab without having to select it manually?

 

Many thanks in advance!

Darren

0 Likes
794 Views
8 Replies
Replies (8)
Message 2 of 9

bradeneuropeArthur
Mentor
Mentor

Unfortunately think it is not.

Why not creating your own dialog with the physical properties on it?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 3 of 9

BrianEkins
Mentor
Mentor

The Inventor API does not support this.  It should be possible to do using the Windows API, but it wouldn't be trivial to do.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 4 of 9

bradeneuropeArthur
Mentor
Mentor

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

FormPhysicalProps.JPG

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 & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 5 of 9

chandra.shekar.g
Autodesk Support
Autodesk Support

@isocam,

 

@BrianEkins is right. Unfortunately, Inventor API does not support to display "Physical" tab. please suggest this wish list at idea station using below link.

 

https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 6 of 9

frederic.vandenplas
Collaborator
Collaborator

Hi,

 

Ofcourse this is possible, you need to use Execute2 and then you can send keys to any dialog with vba

Sub ActivatePhysicalTab()

ThisApplication.CommandManager.ControlDefinitions.Item("AppiPropertiesWrapperCmd").Execute2 (False)
Call SendKeys("{%}")
Call SendKeys("{RIGHT}")
Call SendKeys("{RIGHT}")
Call SendKeys("{RIGHT}")
Call SendKeys("{RIGHT}")
Call SendKeys("{RIGHT}")
Call SendKeys("{RIGHT}")

End Sub
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 7 of 9

bradeneuropeArthur
Mentor
Mentor

Good possible solution!

The only thing is that send keys are a bit tricky, regarding their possible unwanted behavior!

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

0 Likes
Message 8 of 9

frederic.vandenplas
Collaborator
Collaborator

@bradeneuropeArthur i know, but i don't see any issues with this one here.

I've done it in the past for settings in dialogs for example Detail views, and there indeed you need to watch out for unexpected behaviour.

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
0 Likes
Message 9 of 9

DRoam
Mentor
Mentor

I had some trouble with the snippets above, and I was also trying to get it to work in iLogic rather than VBA. After experimenting, the following methods seem to work well for VBA and iLogic respectively:

 

VBA:

Sub OpenPhysicalProperties()
    ThisApplication.CommandManager.ControlDefinitions.Item("AppiPropertiesWrapperCmd").Execute2 (False)
    SendKeys ("{RIGHT 6}")
End Sub

 

iLogic

Sub OpenPhysicalProperties()
    ThisApplication.CommandManager.ControlDefinitions.Item("AppiPropertiesWrapperCmd").Execute2(False)
    System.Windows.Forms.SendKeys.SendWait("{RIGHT 6}")
End Sub