Examples#

FLAT230#

Create a FLAT230 TLine definition, and then create an instance of that.

from mhi.xml.pscad import ProjectFile

# Create an example project
prj = ProjectFile.create("Example.pscx", overwrite=True)

# Create a new TLine definition
flat230 = prj.definition.create_tline('FLAT230')

# Create bergeron options component by merely mentioning it.
flat230.bergeron_options

# Create ground data component (by mentioning it) and change a parameter
flat230.ground.parameters.EarthForm = 'Analytical approximation (Wedepohl)'

# Create a 3 conductor tower component
twr = flat230.tower_3_flat(0, 30, 10)

# Alter the tower parameters for a 3H4 frame with 2 ground wires
twr.parameters.SHSag = True
twr.parameters.ShuntG = "1.0E-10 [mho/m]"
twr.parameters.TName = "H-Frame-3H4"
twr.parameters.YG = "5 [m]"
twr.parameters.NCondB = 2
twr.parameters.GName = "1/2\\\\"

# Crate the component on the canvas
main = prj.canvas('Main')
tl = flat230.create_instance(main, (2, 1), (8, 2))

# And save
prj.save()