Table Of Contents

Previous topic

Detailed Installation

Next topic

The Expression Class

This Page

General-Use Functions

Expose the HFSS Windows COM API.

Example Usage

>>> import hycohanz as hfss
>>> [oAnsoftApp, oDesktop] = hfss.setup_interface()
>>> hfss.quit_application(oDesktop)
hycohanz.hycohanz.add_property(oDesign, name, value)

Add a design property.

Parameters :

oDesign : pywin32 COMObject

The HFSS design from which to retrieve the module.

name : str

The name of the property to add.

value : Hyphasis Expression object

The value of the property.

Returns :

None :

hycohanz.hycohanz.assign_perfect_e(oDesign, boundaryname, facelist, InfGroundPlane=False)

Create a perfect E boundary.

Parameters :

oDesign : pywin32 COMObject

The HFSS design to which this function is applied.

boundaryname : str

The name to give this boundary in the Boundaries tree.

facelist : list of ints

The faces to assign to this boundary condition.

Returns :

None :

hycohanz.hycohanz.assign_perfect_h(oDesign, boundaryname, facelist)

Create a perfect H boundary.

Parameters :

oDesign : pywin32 COMObject

The HFSS design to which this function is applied.

boundaryname : str

The name to give this boundary in the Boundaries tree.

facelist : list of ints

The faces to assign to this boundary condition.

Returns :

None :

hycohanz.hycohanz.assign_radiation(oDesign, faceidlist, IsIncidentField=False, IsEnforcedField=False, IsFssReference=False, IsForPML=False, UseAdaptiveIE=False, IncludeInPostproc=True, Name=u'Rad1')

Assign a radiation boundary on the given faces.

Parameters :

oDesign : pywin32 COMObject

The HFSS design to which this function is applied.

faceidlist : list of ints

The faces to assign to this boundary condition.

IsIncidentField : bool

If True, same as checking the “Incident Field” radio button in the Radiation Boundary setup dialog. Mutually-exclusive with IsEnforcedField

IsEnforcedField : bool

If True, same as checking the “Enforced Field” radio button in the Radiation Boundary setup dialog. Mutually-exclusive with IsIncidentField

IsFssReference : bool

If IsEnforcedField is False, is equivalent to checking the “Reference for FSS” check box i the Radiation Boundary setup dialog.

IsForPML : bool

Not explored at this time. Likely use case is when defining a radiation boundary in conjuction with PMLs where the boundary lies on the surface between the PML and the PML base object.

UseAdaptiveIE : bool

Not explored at this time. It is likely that setting this to True is equivalent to selecting the “Model exterior as HFSS-IE domain” check box in the Radiation Boundary setup dialog.

IncludeInPostproc : bool

Not explored at this time. Likely use case is to remove certain boundaries from consideration during certain postprocessing operations, such as when computing the radiation pattern.

Name : str

The name to assign the boundary.

Returns :

——- :

None :

hycohanz.hycohanz.assign_waveport_multimode(oDesign, portname, faceidlist, Nmodes=1, RenormalizeAllTerminals=True, UseLineAlignment=False, DoDeembed=False, ShowReporterFilter=False, ReporterFilter=[True], UseAnalyticAlignment=False)

Assign a waveport excitation using multiple modes.

Parameters :

oDesign : pywin32 COMObject

The HFSS design to which this function is applied.

portname : str

Name of the port to create.

faceidlist : list

List of face id integers.

Nmodes : int

Number of modes with which to excite the port.

Returns :

None :

hycohanz.hycohanz.close_all_projects(oDesktop)

Close all open projects.

Parameters :

oDesktop : pywin32 COMObject

The HFSS desktop object upon which to operate.

Returns :

None :

hycohanz.hycohanz.close_all_projects_except_current(oDesktop)

Close all open projects except the active project.

Parameters :

oDesktop : pywin32 COMObject

The HFSS desktop object upon which to operate.

Returns :

None :

hycohanz.hycohanz.close_current_project(oDesktop)

Close the active project.

Parameters :

oDesktop : pywin32 COMObject

The HFSS desktop object upon which to operate.

Returns :

None :

hycohanz.hycohanz.close_project_byhandle(oDesktop, oProject)

Close the specified project using the given HFSS project object.

Parameters :

oDesktop : pywin32 COMObject

The HFSS desktop object upon which to operate.

oProject : pywin32 COMObject

The HFSS project object upon which to operate.

Returns :

None :

hycohanz.hycohanz.close_project_byname(oDesktop, projectname)

Close the specified project using the given HFSS project object.

Parameters :

oDesktop : pywin32 COMObject

The HFSS desktop object upon which to operate.

projectname : string

The name of the HFSS project to close.

Returns :

None :

hycohanz.hycohanz.get_active_project(oDesktop)

Get a handle for the active project.

Parameters :

oDesktop : pywin32 COMObject

The HFSS desktop object upon which to operate.

Returns :

oProject : pywin32 COMObject

The HFSS project object upon which to operate.

hycohanz.hycohanz.get_module(oDesign, ModuleName)

Get a module handle for the given module.

Parameters :

oDesign : pywin32 COMObject

The HFSS design object upon which to operate.

ModuleName : str

Name of the module to return. One of
  • “BoundarySetup”
  • “MeshSetup”
  • “AnalysisSetup”
  • “Optimetrics”
  • “Solutions”
  • “FieldsReporter”
  • “RadField”
  • “UserDefinedSolutionModule”
Returns :

oModule : pywin32 COMObject

Handle to the given module

hycohanz.hycohanz.get_project_name(oProject)

Get the name of the specified project.

Parameters :

oProject : pywin32 COMObject

The HFSS project object upon which to operate.

Returns :

str :

The name of the project.

hycohanz.hycohanz.get_projects(oDesktop)

Get the list of open projects.

Parameters :

oDesktop : pywin32 COMObject

The HFSS desktop object upon which to operate.

Returns :

oProject : list of pywin32 COMObjects

The HFSS desktop object upon which to operate.

hycohanz.hycohanz.insert_analysis_setup(oDesign, Frequency, PortsOnly=True, MaxDeltaS=0.02, Name=u'Setup1', UseMatrixConv=False, MaximumPasses=20, MinimumPasses=2, MinimumConvergedPasses=2, PercentRefinement=30, IsEnabled=True, BasisOrder=2, UseIterativeSolver=False, DoLambdaRefine=True, DoMaterialLambda=True, SetLambdaTarget=True, Target=0.6667, UseMaxTetIncrease=False, PortAccuracy=2, UseABCOnPort=False, SetPortMinMaxTri=False, EnableSolverDomains=False, ThermalFeedback=False, NoAdditionalRefinementOnImport=False)

Insert an HFSS analysis setup.

hycohanz.hycohanz.insert_design(oProject, designname, solutiontype)

Insert an HFSS design. The scripting interface doesn’t appear to support creation of HFSS-IE designs at this time, or is undocumented.

Parameters :

oProject : pywin32 COMObject

The HFSS project in which the operation will be performed.

designname : str

Name of the design to insert.

solutiontype : str

Name of the solution type. One of (“DrivenModal”,

“DrivenTerminal”, “Eigenmode”)

Returns :

oDesign : pywin32 COMObject

The created HFSS design.

hycohanz.hycohanz.insert_frequency_sweep(oDesign, setupname, sweepname, startvalue, stopvalue, stepsize, IsEnabled=True, SetupType=u'LinearStep', Type=u'Discrete', SaveFields=True, ExtrapToDC=False)

Insert an HFSS frequency sweep.

Parameters :

oAnalysisSetup : pywin32 COMObject

The HFSS Analysis Setup Module in which to insert the sweep.

setupname : string

The name of the setup to add

sweepname : string

The desired name of the sweep

startvalue : float

Lowest frequency in Hz.

stopvalue : float

Highest frequency in Hz.

stepsize : flot

The frequency increment in Hz.

IsEnabled : bool

Whether the sweep is enabled.

SetupType : string

The type of sweep setup to add. One of “LinearStep”, “LinearCount”, or “SinglePoints”. Currently only “LinearStep” is supported.

Type : string

The type of sweep to perform. One of “Discrete”, “Fast”, or “Interpolating”. Currently only “Discrete” is supported.

Savefields : bool

Whether to save the fields.

ExtrapToDC : bool

Whether extrapolation to DC is enabled.

Returns :

None :

hycohanz.hycohanz.new_project(oDesktop)

Create a new project. The new project becomes the active project.

Parameters :

oDesktop : pywin32 COMObject

HFSS Desktop object in which to create the new project.

Returns :

oProject : pywin32 COMObject

The created HFSS project.

hycohanz.hycohanz.quit_application(oDesktop)

Exit HFSS.

Parameters :

oDesktop : pywin32 COMObject

HFSS Desktop object.

Returns :

None :

Examples

>>> import Hyphasis as hfss
>>> [oAnsoftApp, oDesktop] = hfss.setup_interface()
>>> hfss.quit_application(oDesktop)
hycohanz.hycohanz.set_active_editor(oDesign, editorname=u'3D Modeler')

Set the active editor.

Parameters :

oDesign : pywin32 COMObject

The HFSS design upon which to operate.

editorname : str

Name of the editor to set as active. As of this writing “3D Modeler” is the only known valid value.

Returns :

oEditor : pywin32 COMObject

The HFSS Editor object.

hycohanz.hycohanz.setup_interface()

Set up the COM interface to the running HFSS process.

Returns :

oAnsoftApp : pywin32 COMObject

Handle to the HFSS application interface

oDesktop : pywin32 COMObject

Handle to the HFSS desktop interface

Examples

>>> import Hyphasis as hfss
>>> [oAnsoftApp, oDesktop] = hfss.setup_interface()