The rotation of a nodal support is defined by means of a user-defined coordinate system. In the following example, a nodal support is rotated 45 ° about the z-axis. It is not necessary to define a new coordinate system via nodes. In this case, it is sufficient to use the RotatedSystemType option, which allows for spatial rotation of the support via three rotations about the x-, y-, and z-axes. The rotation is entered in radians:
Sub test_nodal_support()
Dim iApp As RFEM5.ApplicationSet iApp = GetObject(, "RFEM5.Application")
iApp.LockLicense
Dim iMod As RFEM5.IModel3Set iMod = iApp.GetActiveModel
On Error GoTo e
' get interface of modeldataDim iModData As RFEM5.IModelData2Set iModData = iMod.GetModelData
' get interface of nodal supportDim iNs As RFEM5.INodalSupportSet iNs = iModData.GetNodalSupport(1, AtNo)
' get nodal support dataDim ns As RFEM5.NodalSupportns = iNs.GetData
' modify datans.ReferenceSystem = UserDefinedSystemTypens.UserDefinedReferenceSystem.Axis1 = AxisXns.UserDefinedReferenceSystem.Axis2 = AxisYns.UserDefinedReferenceSystem.Type = RotatedSystemTypens.UserDefinedReferenceSystem.RotationAngles.X = 0ns.UserDefinedReferenceSystem.RotationAngles.Y = 0ns.UserDefinedReferenceSystem.RotationAngles.Z = 45 * 3.14159265359 / 180
' set nodal support dataiModData.PrepareModificationiNs.SetData nsiModData.FinishModification
e:
If Err.Number <> 0 Then MsgBox Err.description, vbCritical, Err.Source
iMod.GetApplication.UnlockLicenseSet iMod = Nothing
End Sub
The program takes the existing nodal support from the currently opened model and modifies it. Since the user-defined coordinate system is not a direct part of the INodalSupport interface of the nodal support, the rotation can also be transferred when creating a nodal support, of course.