Use the UDF function in VBA (macros Excel)

0 Roberto posted this 28 March 2019

How to call the Nax2Cell UDF from a Macro in VBA

Last Edited 28 March 2019

0 Like 0 Dislike
1 Comments
Order By Standard | Newest | Votes | All
0 Roberto posted this 28 March 2019

Hi

Here I post you an example, how to use the Nax2cell UDF´s in a Macro in VBA. In this example, you will get the stress in cquad4 for every load cases in the variable Results.

Sub Example() Dim LoadCases As Variant Dim Results As Variant file = "EXAMPLE_0001.op2" 'Getting load cases LoadCases = Application.Run("NASTRAN.Subcases", file) 'Getting the results Results = Application.Run("NASTRAN.Results", file, "STRESSES", "CQUAD4", LoadCases, "all", 2, 3, , 1) End Sub

Regards

Last Edited 28 March 2019

0 Like 0 Dislike
# Link