Click or drag to resize

Adding Field Probes

The examples below will show you how to create field probes using EMA3D API.

This example shows how to create and antenna far field probe.

Box Field Probe Creation
# Python Script, API Version = V251
# Import EMA API dll and Core namespace
import clr
apipath = "ema3d.Api.V25.dll"
clr.AddReferenceToFileAndPath(apipath)
import ema3d.Api.V25.Core as Core
import ema3d.Api.V25.Core.Domain.Domain as Domain

# get document
doc = Window.ActiveWindow.Document

# create domain
domain = Domain.GetInstance(doc)
Domain.ResetDomainBounds(domain)

# create and update probe
probe = Core.Probes.AntennaFarFieldProbe.Create(doc)

probe.MinimumX = 0
probe.MinimumY = 0
probe.MinimumZ = 0

probe.MaximumX = 120
probe.MaximumY = 120
probe.MaximumZ = 0

probe.ResultDomain = Core.Probes.AntennaResultsDomain.Frequency
probe.ResultDimension = Core.Probes.AntennaResultsDimension.Sphere

# Refresh Stage to show EMA Tree
Solution.Stages.SetStage("EMA3D")

This example shows how to create a box field probe. We first create two points for the bounds of our box probe, create a domain, then create and update properties on the box field probe.

Box Field Probe Creation
# Import EMA API dll and Core namespace
import clr
apipath = "ema3d.Api.V25.dll"
clr.AddReferenceToFileAndPath(apipath)
import ema3d.Api.V25.Core as Core

# clear existing workspace
ClearAll()

# create 2 ICurvePoints as Bounds for the Box Probe
point = Point.Create(MM(0), MM(0), MM(0))
result = SketchPoint.Create(point)
i_curve_point_one = result.CreatedCurves[0].GetChildren[ICurvePoint]()[0]

point = Point.Create(MM(100), MM(100), MM(100))
result = SketchPoint.Create(point)
i_curve_point_two = result.CreatedCurves[0].GetChildren[ICurvePoint]()[0]

# get document
doc = Window.ActiveWindow.Document

# create domain
domain = Core.Domain.Domain.GetInstance(doc)
Core.Domain.Domain.ResetDomainBounds(domain)

# Create Box Field Probe
probe = Core.Probes.BoxFieldProbe.Create(doc, i_curve_point_one, i_curve_point_two)
probe.Type = Core.FieldType.HField
probe.DisplayName = "Hello world"
probe.MaximumX = .2
probe.MaxSamples = 225

# Refresh Stage to show EMA Tree
Solution.Stages.SetStage("EMA3D")

The example below shows how to create a point field probe. Similar to a box field probe but you only need one point to create the probe.

Point Field Probe Creation
# Import EMA API dll and Core namespace
import clr
apipath = "ema3d.Api.V25.dll"
clr.AddReferenceToFileAndPath(apipath)
import ema3d.Api.V25.Core as Core

# clear existing workspace
ClearAll()

# create a point
point = Point.Create(MM(0), MM(0), MM(0))
result = SketchPoint.Create(point)
i_curve_point = result.CreatedCurves[0].GetChildren[ICurvePoint]()[0]

# get document
doc = Window.ActiveWindow.Document

# create domain
domain = Core.Domain.Domain.GetInstance(doc)
Core.Domain.Domain.ResetDomainBounds(domain)

# create and update probe
probe = Core.Probes.PointFieldProbe.Create(doc, i_curve_point)
    # Modify TEnd
_tend = probe.TEnd
_tend.MatchDomainType = Core.MatchDomainType.None
_tend.Value = 1e-8
probe.TEnd = _tend
probe.Type = Core.FieldType.HField
probe.DisplayName = "Hello world"

# clone and update cloned probe
new_probe = probe.Clone()
new_probe.DisplayName = "Hello world 2"
    # Modify TStep to match the nyquist frequency
_tstep = new_probe.TStep
_tstep.MatchDomainType = Core.MatchDomainType.Frequency
new_probe.TStep = _tstep
new_probe.Type = Core.FieldType.EField

# Refresh Stage to show EMA Tree
Solution.Stages.SetStage("EMA3D")

The example below shows how to create a far field probe.

Point Field Probe Creation
# Python Script, API Version = V251
# Import EMA API dll and Core namespace
import clr
apipath = "ema3d.Api.V25.dll"
clr.AddReferenceToFileAndPath(apipath)
import ema3d.Api.V25.Core as Core
import ema3d.Api.V25.Core.Domain.Domain as Domain

# get document
doc = Window.ActiveWindow.Document

# create domain
domain = Domain.GetInstance(doc)
Domain.ResetDomainBounds(domain)

# create and update probe
probe = Core.Probes.FarFieldProbe.Create(doc)

#Set Location
probe.locationX = 100
probe.locationY = 100
probe.locationZ = 100

#Set Orientation
_orientation = probe.Orientation
_orientation.Phi = 91
_orientation.Theta = 91
probe.Orientation = _orientation

# Field Type and Display Name
probe.FieldType = Core.FieldType.HField
probe.DisplayName = "Hello world"

# Refresh Stage to show EMA Tree
Solution.Stages.SetStage("EMA3D")