# encoding: utf-8
# Release 18.0
SetScriptVersion(Version="18.0.351")
template1 = GetTemplate(
    TemplateName="Static Structural",
    Solver="ANSYS")
system1 = template1.CreateSystem()
unitSystem1 = SetProjectUnitSystem(UnitSystemName="NMMTON_STANDARD")
engineeringData1 = system1.GetContainer(ComponentName="Engineering Data")
material1 = engineeringData1.GetMaterial(Name="Structural Steel")
matlProp1 = material1.GetProperty(Name="Density")
matlProp1.SetVariableProperty(
    VariableName="Density",
    Property="Unit",
    Value="tonne mm^-3")
matlProp1.SetData(
    Variables=["Density"],
    Values=[["7.85E-09 [tonne mm^-3]"]])
matlProp2 = material1.GetProperty(Name="Elasticity")
matlProp2.SetVariableProperty(
    VariableName="Young's Modulus",
    Property="Unit",
    Value="MPa")
matlProp2.SetData(
    Variables=["Young's Modulus"],
    Values=[["200000 [MPa]"]])
matlProp3 = material1.CreateProperty(
    Name="Isotropic Hardening",
    Definition="Bilinear",
    Qualifiers={"Definition": "Bilinear", "Behavior": ""})
matlProp3.SetVariableProperty(
    VariableName="Yield Strength",
    Property="Unit",
    Value="MPa")
matlProp3.SetVariableProperty(
    VariableName="Tangent Modulus",
    Property="Unit",
    Value="MPa")
matlProp3.SetData(
    Index=-1,
    Variables=["Yield Strength"],
    Values=[["250 [MPa]"]])
matlProp3.SetData(
    Variables=["Tangent Modulus"],
    Values=[["2000 [MPa]"]])
favorites1 = EngData.LoadFavoriteItems()
EngData.EnableFilter(Enable=False)
Update()
Refresh()
Update()
geometry1 = system1.GetContainer(ComponentName="Geometry")
geometry1.SetFile(FilePath="G:/Study/Bolotov/popytka s boltami/2_plity.x_t")
geometry1.Edit(IsSpaceClaimGeometry=True)
geometry1.Exit()
geometry1.Edit()
geometry1.Exit()
modelComponent1 = system1.GetComponent(Name="Model")
modelComponent1.Refresh()
model1 = system1.GetContainer(ComponentName="Model")
model1.Edit()
model1.Exit()
system2 = template1.CreateSystem(
    Position="Right",
    RelativeTo=system1)
engineeringData2 = system2.GetContainer(ComponentName="Engineering Data")
material2 = engineeringData2.GetMaterial(Name="Structural Steel")
matlProp4 = material2.GetProperty(Name="Density")
matlProp4.SetVariableProperty(
    VariableName="Density",
    Property="Unit",
    Value="tonne mm^-3")
matlProp4.SetData(
    Variables=["Density"],
    Values=[["7.85E-09 [tonne mm^-3]"]])
matlProp5 = material2.GetProperty(Name="Elasticity")
matlProp5.SetVariableProperty(
    VariableName="Young's Modulus",
    Property="Unit",
    Value="MPa")
matlProp5.SetData(
    Variables=["Young's Modulus"],
    Values=[["200000 [MPa]"]])
matlProp6 = material2.CreateProperty(
    Name="Isotropic Hardening",
    Definition="Bilinear",
    Qualifiers={"Definition": "Bilinear", "Behavior": ""})
matlProp6.SetVariableProperty(
    VariableName="Yield Strength",
    Property="Unit",
    Value="MPa")
matlProp6.SetVariableProperty(
    VariableName="Tangent Modulus",
    Property="Unit",
    Value="MPa")
matlProp6.SetData(
    Index=-1,
    Variables=["Yield Strength"],
    Values=[["250 [MPa]"]])
matlProp6.SetData(
    Variables=["Tangent Modulus"],
    Values=[["20000 [MPa]"]])
Update()
Save(Overwrite=True)
system1.DisplayText = "просто плита"
system1.DisplayText = "просто 2 плиты"
system2.DisplayText = "проставка с диском"
geometry2 = system2.GetContainer(ComponentName="Geometry")
geometry2.SetFile(FilePath="G:/Study/Bolotov/08.06.17/Bolty.prt")
geometry2.Edit(IsSpaceClaimGeometry=True)
geometry2.Exit()
geometry2.Edit()
geometry2.Exit()
modelComponent2 = system2.GetComponent(Name="Model")
modelComponent2.Refresh()
model2 = system2.GetContainer(ComponentName="Model")
model2.Edit()
model1.Edit()
model2.Exit()
model1.Exit()
system3 = system1.Duplicate(RelativeTo=system1)
geometry3 = system3.GetContainer(ComponentName="Geometry")
geometry3.Edit()
geometry3.Exit()
modelComponent3 = system3.GetComponent(Name="Model")
modelComponent3.Refresh()
model3 = system3.GetContainer(ComponentName="Model")
model3.Edit()
model3.Exit()
system2.Delete()
system3.DisplayText = "2 плиты"
system3.DisplayText = "2 плиты с буртом, frictionless"
system4 = system3.Duplicate(RelativeTo=system3)
system4.DisplayText = "2 плиты с буртом, friction 0.15"
model4 = system4.GetContainer(ComponentName="Model")
model4.Edit()
model4.Exit()
model1.Edit()
model1.Exit()
system1.DisplayText = "просто 2 плиты, frictionless"
system5 = system1.Duplicate(RelativeTo=system1)
system5.DisplayText = "просто 2 плиты, frictional 0.13"
model5 = system5.GetContainer(ComponentName="Model")
model5.Edit()
model5.Exit()
model4.Edit()
model4.Exit()
Save(Overwrite=True)
