# ---------------------------------------------- # Script Recorded by ANSYS Electronics Desktop Version 2019.3.0 # 16:53:32 Dec 03, 2019 # ---------------------------------------------- import ScriptEnv ScriptEnv.Initialize("Ansoft.ElectronicsDesktop") oDesktop.RestoreWindow() oProject = oDesktop.SetActiveProject("ushape") oDesign = oProject.SetActiveDesign("HFSSDesign1") oEditor = oDesign.SetActiveEditor("3D Modeler") oEditor.CreateBox( [ "NAME:BoxParameters", "XPosition:=" , "Lb/2", "YPosition:=" , "-Wb/2", "ZPosition:=" , "0mm", "XSize:=" , "-Lb", "YSize:=" , "Wb", "ZSize:=" , "Hb" ], [ "NAME:Attributes", "Name:=" , "board", "Flags:=" , "", "Color:=" , "(143 175 143)", "Transparency:=" , 0, "PartCoordinateSystem:=", "Global", "UDMId:=" , "", "MaterialValue:=" , "\"FR4_epoxy\"", "SurfaceMaterialValue:=", "\"\"", "SolveInside:=" , True, "IsMaterialEditable:=" , True, "UseMaterialAppearance:=", False, "IsLightweight:=" , False ]) oEditor.CreateRectangle( [ "NAME:RectangleParameters", "IsCovered:=" , True, "XStart:=" , "Lb/2", "YStart:=" , "-l2/2", "ZStart:=" , "Hb", "Width:=" , "-l1", "Height:=" , "l2", "WhichAxis:=" , "Z" ], [ "NAME:Attributes", "Name:=" , "Rectangle1", "Flags:=" , "", "Color:=" , "(143 175 143)", "Transparency:=" , 0, "PartCoordinateSystem:=", "Global", "UDMId:=" , "", "MaterialValue:=" , "\"vacuum\"", "SurfaceMaterialValue:=", "\"\"", "SolveInside:=" , True, "IsMaterialEditable:=" , True, "UseMaterialAppearance:=", False, "IsLightweight:=" , False ]) oEditor.CreateRectangle( [ "NAME:RectangleParameters", "IsCovered:=" , True, "XStart:=" , "Lb/2", "YStart:=" , "-l2/2+Wt", "ZStart:=" , "Hb", "Width:=" , "-l1+Wt", "Height:=" , "l2-2*Wt", "WhichAxis:=" , "Z" ], [ "NAME:Attributes", "Name:=" , "Rectangle2", "Flags:=" , "", "Color:=" , "(143 175 143)", "Transparency:=" , 0, "PartCoordinateSystem:=", "Global", "UDMId:=" , "", "MaterialValue:=" , "\"vacuum\"", "SurfaceMaterialValue:=", "\"\"", "SolveInside:=" , True, "IsMaterialEditable:=" , True, "UseMaterialAppearance:=", False, "IsLightweight:=" , False ]) oEditor.Subtract( [ "NAME:Selections", "Blank Parts:=" , "Rectangle1", "Tool Parts:=" , "Rectangle2" ], [ "NAME:SubtractParameters", "KeepOriginals:=" , False ]) oEditor.ChangeProperty( [ "NAME:AllTabs", [ "NAME:Geometry3DAttributeTab", [ "NAME:PropServers", "Rectangle1" ], [ "NAME:ChangedProps", [ "NAME:Name", "Value:=" , "trace" ] ] ] ]) oEditor.SweepAlongVector( [ "NAME:Selections", "Selections:=" , "trace", "NewPartsModelFlag:=" , "Model" ], [ "NAME:VectorSweepParameters", "DraftAngle:=" , "0deg", "DraftType:=" , "Round", "CheckFaceFaceIntersection:=", False, "SweepVectorX:=" , "0mm", "SweepVectorY:=" , "0mm", "SweepVectorZ:=" , "Ht" ]) oEditor.ChangeProperty( [ "NAME:AllTabs", [ "NAME:Geometry3DAttributeTab", [ "NAME:PropServers", "trace" ], [ "NAME:ChangedProps", [ "NAME:Material", "Value:=" , "\"copper\"" ] ] ] ]) oEditor.ChangeProperty( [ "NAME:AllTabs", [ "NAME:Geometry3DAttributeTab", [ "NAME:PropServers", "trace" ], [ "NAME:ChangedProps", [ "NAME:Color", "R:=" , 255, "G:=" , 255, "B:=" , 0 ] ] ] ]) oEditor.CreateRectangle( [ "NAME:RectangleParameters", "IsCovered:=" , True, "XStart:=" , "Lb/2", "YStart:=" , "-Wb/2", "ZStart:=" , "0mm", "Width:=" , "-Lb", "Height:=" , "Wb", "WhichAxis:=" , "Z" ], [ "NAME:Attributes", "Name:=" , "gnd", "Flags:=" , "", "Color:=" , "(143 175 143)", "Transparency:=" , 0, "PartCoordinateSystem:=", "Global", "UDMId:=" , "", "MaterialValue:=" , "\"copper\"", "SurfaceMaterialValue:=", "\"\"", "SolveInside:=" , True, "IsMaterialEditable:=" , True, "UseMaterialAppearance:=", False, "IsLightweight:=" , False ]) oEditor.ChangeProperty( [ "NAME:AllTabs", [ "NAME:Geometry3DAttributeTab", [ "NAME:PropServers", "gnd" ], [ "NAME:ChangedProps", [ "NAME:Color", "R:=" , 255, "G:=" , 255, "B:=" , 0 ] ] ] ]) oEditor.SweepAlongVector( [ "NAME:Selections", "Selections:=" , "gnd", "NewPartsModelFlag:=" , "Model" ], [ "NAME:VectorSweepParameters", "DraftAngle:=" , "0deg", "DraftType:=" , "Round", "CheckFaceFaceIntersection:=", False, "SweepVectorX:=" , "0mm", "SweepVectorY:=" , "0mm", "SweepVectorZ:=" , "-Ht" ]) oEditor.ChangeProperty( [ "NAME:AllTabs", [ "NAME:Geometry3DAttributeTab", [ "NAME:PropServers", "trace" ], [ "NAME:ChangedProps", [ "NAME:Solve Inside", "Value:=" , True ] ] ] ]) #ports oEditor.CreateRectangle( [ "NAME:RectangleParameters", "IsCovered:=" , True, "XStart:=" , "Lb/2", "YStart:=" , "-l2/2", "ZStart:=" , "-Ht", "Width:=" , "Wt", "Height:=" , "2*Ht+Hb", "WhichAxis:=" , "X" ], [ "NAME:Attributes", "Name:=" , "P1", "Flags:=" , "", "Color:=" , "(143 175 143)", "Transparency:=" , 0, "PartCoordinateSystem:=", "Global", "UDMId:=" , "", "MaterialValue:=" , "\"vacuum\"", "SurfaceMaterialValue:=", "\"\"", "SolveInside:=" , True, "IsMaterialEditable:=" , True, "UseMaterialAppearance:=", False, "IsLightweight:=" , False ]) oEditor.CreateRectangle( [ "NAME:RectangleParameters", "IsCovered:=" , True, "XStart:=" , "Lb/2", "YStart:=" , "l2/2", "ZStart:=" , "-Ht", "Width:=" , "-Wt", "Height:=" , "2*Ht+Hb", "WhichAxis:=" , "X" ], [ "NAME:Attributes", "Name:=" , "P2", "Flags:=" , "", "Color:=" , "(143 175 143)", "Transparency:=" , 0, "PartCoordinateSystem:=", "Global", "UDMId:=" , "", "MaterialValue:=" , "\"vacuum\"", "SurfaceMaterialValue:=", "\"\"", "SolveInside:=" , True, "IsMaterialEditable:=" , True, "UseMaterialAppearance:=", False, "IsLightweight:=" , False ]) #airbox oEditor.CreateBox( [ "NAME:BoxParameters", "XPosition:=" , "-(1.5*Lb)/2", "YPosition:=" , "-(1.5*Wb)/2", "ZPosition:=" , "-1.5*Hb", "XSize:=" , "1.5*Lb", "YSize:=" , "1.5*Wb", "ZSize:=" , "10*1.5*Hb" ], [ "NAME:Attributes", "Name:=" , "Box1", "Flags:=" , "", "Color:=" , "(143 175 143)", "Transparency:=" , 0, "PartCoordinateSystem:=", "Global", "UDMId:=" , "", "MaterialValue:=" , "\"vacuum\"", "SurfaceMaterialValue:=", "\"\"", "SolveInside:=" , True, "IsMaterialEditable:=" , True, "UseMaterialAppearance:=", False, "IsLightweight:=" , False ]) oModule = oDesign.GetModule("BoundarySetup") oModule.AssignLumpedPort( [ "NAME:1", "Objects:=" , ["P1"], "RenormalizeAllTerminals:=", True, "DoDeembed:=" , False, [ "NAME:Modes", [ "NAME:Mode1", "ModeNum:=" , 1, "UseIntLine:=" , True, [ "NAME:IntLine", "Start:=" , ["63.5mm","-11.195mm","-0.0169999999999997mm"], "End:=" , ["63.5mm","-11.195mm","1.5918mm"] ], "AlignmentGroup:=" , 0, "CharImp:=" , "Zpi", "RenormImp:=" , "50ohm" ] ], "ShowReporterFilter:=" , False, "ReporterFilter:=" , [True], "Impedance:=" , "50ohm" ]) oModule.AssignLumpedPort( [ "NAME:2", "Objects:=" , ["P2"], "RenormalizeAllTerminals:=", True, "DoDeembed:=" , False, [ "NAME:Modes", [ "NAME:Mode1", "ModeNum:=" , 1, "UseIntLine:=" , True, [ "NAME:IntLine", "Start:=" , ["63.5mm","11.195mm","-0.0169999999999997mm"], "End:=" , ["63.5mm","11.195mm","1.5918mm"] ], "AlignmentGroup:=" , 0, "CharImp:=" , "Zpi", "RenormImp:=" , "50ohm" ] ], "ShowReporterFilter:=" , False, "ReporterFilter:=" , [True], "Impedance:=" , "50ohm" ]) oModule.AssignRadiation( [ "NAME:Rad1", "Objects:=" , ["Box1"], "IsFssReference:=" , False, "IsForPML:=" , False ]) oProject.Save()