Use the UDF function in VBA (macros Excel)

0 Roberto posted this 4 Weeks ago

How to call the Nax2Cell UDF from a Macro in VBA

Last Edited 4 Weeks ago

0 Like 0 Dislike
1 Comments
Order By Standard | Newest | Votes | All
0 Roberto posted this 4 Weeks ago

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 4 Weeks ago

0 Like 0 Dislike
# Link