Vous êtes sur la page 1sur 7

# encoding: utf-8 SetScriptVersion(Version="14.5") Extensions.LoadExtension(ExtensionName="ExtPiezo") Extensions.LoadExtension(ExtensionName="IronPythonConsole") template1 = GetTemplate(TemplateName="EngData") system1 = template1.CreateSystem() engineeringData1 = system1.GetContainer(ComponentName="Engineering Data") matl1 = engineeringData1.

CreateMaterial(Name="pzt") matlProp1 = matl1.CreateProperty(Name="Density") matlProp1.SetData( Index=-1, Variables=["Density"], Values=[["7210 [kg m^-3]"]]) matlProp2 = matl1.CreateProperty( Name="Elasticity", Behavior="Anisotropic") matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Variables=["D[*,1]"], Values=[["153000000000 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=1, Variables=["D[*,1]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity",

SheetQualifiers={"Behavior": "Anisotropic"}, Index=2, Variables=["D[*,1]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=3, Variables=["D[*,1]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=1, Variables=["D[*,1]"], Values=[["86000000000 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=2, Variables=["D[*,1]"], Values=[["82000000000 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=4, Variables=["D[*,1]"], Values=[["0 [Pa]"]]) matlProp2.SetData(

SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=5, Variables=["D[*,1]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=1, Variables=["D[*,2]"], Values=[["135000000000 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=2, Variables=["D[*,2]"], Values=[["86000000000 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=3, Variables=["D[*,2]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=4, Variables=["D[*,2]"], Values=[["0 [Pa]"]])

matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=5, Variables=["D[*,2]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=2, Variables=["D[*,3]"], Values=[["153000000000 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=3, Variables=["D[*,3]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=4, Variables=["D[*,3]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=5, Variables=["D[*,3]"],

Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=3, Variables=["D[*,4]"], Values=[["29000000000 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=4, Variables=["D[*,4]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=5, Variables=["D[*,4]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=4, Variables=["D[*,5]"], Values=[["29000000000 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=5,

Variables=["D[*,5]"], Values=[["0 [Pa]"]]) matlProp2.SetData( SheetName="Elasticity", SheetQualifiers={"Behavior": "Anisotropic"}, Index=5, Variables=["D[*,6]"], Values=[["35000000000 [Pa]"]]) matl2 = engineeringData1.CreateMaterial(Name="sub") matlProp3 = matl2.CreateProperty(Name="Density") matlProp3.SetVariableProperty( VariableName="Density", Property="Unit", Value="g cm^-3") matlProp3.SetData( Index=-1, Variables=["Density"], Values=[["2.7 [g cm^-3]"]]) matlProp4 = matl2.CreateProperty( Name="Elasticity", Behavior="Isotropic") matlProp4.SetData( Index=-1, Variables=["Young's Modulus"], Values=[["70000000000 [Pa]"]]) matlProp4.SetData( Variables=["Poisson's Ratio"], Values=[["0.33"]]) Update()

template2 = GetTemplate( TemplateName="Transient Structural", Solver="ANSYS") system2 = template2.CreateSystem( Position="Right", RelativeTo=system1) component1 = system2.GetComponent(Name="Engineering Data") component2 = system1.GetComponent(Name="Engineering Data") component1.ReplaceWithShare( TargetSystem=system2, ComponentToShare=component2, SourceSystem=system1) geometry1 = system2.GetContainer(ComponentName="Geometry") geometry1.Edit() geometry1.Exit() component3 = system2.GetComponent(Name="Model") component3.Refresh() model1 = system2.GetContainer(ComponentName="Model") model1.Edit()

Vous aimerez peut-être aussi