Reply

How do I get Asm mass in a VB form

[ Edited ]

How do I get the mass of a referenced ASM in a vb FORM?

 

For Par, as mentioned by anyone, Example below:

 

 Dim dblDensity As Double                                        'input

 Dim dblAccuracyIn As Double                                    'input Accuracy

 Dim dblVolume As Double                                          'output

 Dim dblArea As Double                                              'output

 Dim dblMass As Double                                              'output

 Dim dblCofGravity(1 To 3) As Double                          'output

 Dim dblCofVolume(1 To 3) As Double                         'output

 Dim dblGlobalMoments(1 To 6) As Double                  'output

 Dim dblPrincipalMoments(1 To 3) As Double               'output

 Dim dblPrincipalAxes(1 To 9) As Double                      'output

 Dim dblRadiiOfGyration(1 To 3) As Double                  'output

 Dim dblAccuracyOut As Double                                    'output Accuracy 

 Dim lngStatus As Long                                                'output *

 

'* Someone said 'IngStatus As Integer'. It's wrong. (For me & VBA)

 

 Set app = GetObject(, "solidedge.application")

 Set act = app.ActiveDocument

 Set mdl = act.models.Item(1)

 

 Call mdl.ComputePhysicalProperties(dblDensity,dblAccuracyIn,dblVolume, dblArea, dblMass, _

     dblCofGravity(), dblCofVolume(), dblGlobalMoments(), dblPrincipalMoments(), dblPrincipalAxes(), dblRadiiOfGyration(), _

     dblAccuracyOut, lngStatus) 

 

For Asm, I think, maybe it's this. (by Spy)

 

 Call obj.GetAssemblyPhysicalProperties(out System.Object, out System.Object, out System.Object, _

     ref System.Object, ref System.Object, ref System.Object, ref System.Object, ref System.Object, ref System.Object, _

     ref System.Object, ref System.Object, out System.Object, out System.Object)

 

More parameter than Par! Why?

 

Please teach me that kind of parameter or  correct method for getting the mass of Asm.

 

 

 

 

 

Posted by: Shoji Nakahara
Post date: 12/26/2011 1:00:00 PM

2 REPLIES

RE: How do I get Asm mass in a VB form

[ Edited ]

From SDK:

Sub GetAssemblyPhysicalProperties ( _

ByRef Mass As Double, _

ByRef Volume As Double, _

ByRef Area As Double, _

ByRef CenterOfMass As Array, _

ByRef CenterOfVolume As Array, _

ByRef GlobalMoments As Array, _

ByRef PrincipalAxis1 As Array, _

ByRef PrincipalAxis2 As Array, _

ByRef PrincipalAxis3 As Array, _

ByRef PrincipalMoments As Array, _

ByRef RadiiOfGyration As Array, _

ByRef IsSick As Boolean, _

ByRef UpdateStatus As Boolean _

)

 

 

Posted by: JR
Post date: 12/27/2011 6:54:10 PM

RE: How do I get Asm mass in a VB form

[ Edited ]

 

Thank you!

 

 

Posted by: Shoji Nakahara
Post date: 12/28/2011 12:06:57 AM