问题描述
我正在尝试在 ANSYS 瞬态结构问题中编写 Python 脚本来定义关节。我已经编写了代码来创建一个关节并定义它的所有元素,除了原点。 在关节中,参考坐标系的原点默认由几何选择定义。 我找不到将其更改为全局坐标的命令。将其更改为全局坐标的 Python 脚本命令是什么?
请注意,我只需要可以直接在编辑器中运行的 Python 脚本命令将其更改为全局坐标。
我当前创建关节的代码是:
joint1=DataModel.Project.Model.Connections.AddJoint()
joint1.ConnectionType=JointscopingType.BodyToGround
named_selection1=DataModel.GetobjectsByName("XYZ")
joint1.PromotetoNamedSelection()
joint1.MobileLocation=named_selection[0]
joint1.Type=JointType.General
joint1.TranslationX=FixedOrFree.Free
joint1.TranslationY=FixedOrFree.Free
joint1.TranslationZ=FixedOrFree.Free
joint1.ReferenceCoordinateSystem.PrimaryAxisDefineBy=CoordinateSystemAlignmentType.GlobalZ
joint1.ReferenceCoordinateSystem.SecondaryAxisDefineBy=CoordinateSystemAlignmentType.GlobalY
解决方法
这应该将原点定义切换到全局坐标:
joint1.ReferenceCoordinateSystem.OriginDefineBy = CoordinateSystemAlignmentType.Fixed