Ansys Workbench 常用的Python Scripting
瀏覽:2428 收藏:2
1.根據(jù)命名讀取結構樹上的信息,如求解項,mesh setup,name selection
DataModel.GetObjectsByName("name")
StaticSys = DataModel.AnalysisByName("Static Structural") #定位到名為"Static Structural"的分析項
# 其他依此類推,可以選擇mesh,name selection, 不過用的時候要注意,不一定好使
2.對未知屬性查看。并根據(jù)此,修改參數(shù)。
obj.Properties obj.VisibleProperties Model.Mesh.Children[5].VisibleProperties #查看某個mesh setup下的可視屬性 # 結果 # [GeometryDefineBy, ComponentSelection, SubValue, SubType, ESize, LocalDefeaturingTolerance, SizingType] Model.Mesh.Children[5].VisibleProperties[5].InternalValue = 0.1 # 根據(jù)此設置defeature size為0.1
3.對某個條件(如mesh, load, fix等),通過name selection賦予幾何屬性
def GetNSByName(name): # 區(qū)分上一個通過get命令的name selection
NSs = ExtAPI.DataModel.Project.Model.NamedSelections.Children
for ns in NSs:
if ns.Name.ToLower() == name.ToLower():
return ns
newMesh = Model.Mesh.AddSizing()
Cns = GetNSByName("B_Covers")
newMesh.Location = Cns
技術鄰APP
工程師必備
工程師必備
- 項目客服
- 培訓客服
- 平臺客服
TOP
1
2




















