Previous topic

The Expression Class

This Page

3D Modeler Functions

hycohanz modeler3d

hycohanz.modeler3d.assign_material(oEditor, partlist, MaterialName=u'vacuum', SolveInside=True)

Assign a material to the specified objects. Only the MaterialName and SolveInside parameters of <AttributesArray> are supported.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

partlist : list

List of part name strings to which the material is applied.

Returns :

None :

hycohanz.modeler3d.copy(oEditor, partlist)

Copy specified parts to the clipboard.

Parameters :

oEditor : pywin32 COMObject

The HFSS Editor in which to perform the operation

partlist : list of strings

The parts to copy

Returns :

None :

hycohanz.modeler3d.create_circle(oEditor, xc, yc, zc, radius, WhichAxis=u'Z', NumSegments=0, Name=u'Circle1', Flags=u'', Color=(132, 132, 193), Transparency=0, PartCoordinateSystem=u'Global', MaterialName=u'"vacuum"', Solveinside=True)

Create a circle primitive.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

xc : float or hycohanz Expression object

yc : float or hycohanz Expression object

zc : float or hycohanz Expression object

The x, y, and z coordinates of the center of the circle.

radius : float

The radius of the circle.

WhichAxis : str

The axis normal to the circle. Can be ‘X’, ‘Y’, or ‘Z’.

NumSegments : int

If 0, the circle is not segmented. Otherwise, the circle is segmented into NumSegments sides.

Name : str

The requested name of the object. If this is not available, HFSS will assign a different name, which is returned by this function.

Flags : str

Flags associated with this object. See HFSS help for details.

Color : tuple of length=3

RGB components of the circle

Transparency : float between 0 and 1

Fractional transparency. 0 is opaque and 1 is transparent.

PartCoordinateSystem : str

The name of the coordinate system in which the object is drawn.

MaterialName : str

Name of the material to assign to the object. Name must be surrounded by double quotes.

SolveInside : bool

Whether to mesh the interior of the object and solve for the fields inside.

Returns :

str :

The actual name of the created object.

hycohanz.modeler3d.create_polyline(oEditor, x, y, z, Name=u'Polyline1', Flags=u'', Color=u'(132 132 193)', Transparency=0, PartCoordinateSystem=u'Global', UDMId=u'', MaterialValue=u'"vacuum"', SolveInside=True, IsPolylineCovered=True, IsPolylineClosed=True, XSectionBendType=u'Corner', XSectionNumSegments=u'0', XSectionHeight=u'0mm', XSectionTopWidth=u'0mm', XSectionWidth=u'0mm', XSectionOrient=u'Auto', XSectionType=u'None', SegmentType=u'Line', NoOfPoints=2)

Draw a polyline.

Warning: HFSS apparently throws an exception whenever IsPolylineClosed=False Warning: HFSS 13 crashes when you click on the last segment in the model tree.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which to perform the operation

x : array_like

The x locations of the polyline vertices. Can have numeric or string elements.

y : array_like

The y locations of the polyline vertices. Can have numeric or string elements.

z : array_like

The z locations of the polyline vertices. Can have numeric or string elements.

Name : str

Requested name of the polyline

Flags : str

Certain flags that can be set. See HFSS Scripting Manual for details.

Transparency : float

Fractional transparency of the object. 0 is opaque, 1 is transparent.

PartCoordinateSystem : str

Coordinate system to use in constructing the object.

UDMId : str

TODO: Add documentation here.

MaterialValue : str

Name of the material to assign to the object.

SolveInside : bool

Whether fields are computed inside the object.

IsPolylineCovered : bool

Whether the polyline is covered.

IsPolylineClosed : bool

Whether the polyline should be considered closed.

TODO: finish documentation of this function. :

Returns :

polyname : str

Actual name of the polyline

x, y, and z are lists with numeric or string elements. :

hycohanz.modeler3d.create_rectangle(oEditor, xs, ys, zs, width, height, WhichAxis=u'Z', Name=u'Rectangle1', Flags=u'', Color=(132, 132, 193), Transparency=0, PartCoordinateSystem=u'Global', UDMId=u'', MaterialValue=u'"vacuum"', SolveInside=True, IsCovered=True)

Draw a rectangle.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

xs : float or hycohanz Expression object

ys : float or hycohanz Expression object

zs : float or hycohanz Expression object

The x, y, and z coordinates of the center of the circle.

width : float or hycohanz Expression object

x-dimension of the rectangle

height : float or hycohanz Expression object

y-dimension of the rectangle

WhichAxis : str

The axis normal to the circle. Can be ‘X’, ‘Y’, or ‘Z’.

Name : str

The requested name of the object. If this is not available, HFSS will assign a different name, which is returned by this function.

Flags : str

Flags associated with this object. See HFSS help for details.

Color : tuple of length=3

RGB components of the circle

Transparency : float between 0 and 1

Fractional transparency. 0 is opaque and 1 is transparent.

PartCoordinateSystem : str

The name of the coordinate system in which the object is drawn.

MaterialName : str

Name of the material to assign to the object. Name must be surrounded by double quotes.

SolveInside : bool

Whether to mesh the interior of the object and solve for the fields inside.

IsCovered : bool

Whether the rectangle is has a surface or has only edges.

Returns :

str :

The actual name of the created object.

hycohanz.modeler3d.create_sphere(oEditor, x, y, z, radius, Name=u'Sphere1', Flags=u'', Color=(132, 132, 193), Transparency=0, PartCoordinateSystem=u'Global', UDMId=u'', MaterialValue=u'"vacuum"', SolveInside=True)

Create a sphere primitive.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

x : float or hycohanz Expression object

x position in Cartesian coordinates.

y : float or hycohanz Expression object

y position in Cartesian coordinates.

z : float or hycohanz Expression object

z position in Cartesian coordinates.

radius : float

The sphere radius.

Name : str

The requested name of the object. HFSS doesn’t necessarily honor this.

Flags : str

Flags to attach to the object. See the HFSS help for explanation of this parameter.

Color : tuple of ints

The RGB indices corresponding to the desired color of the object.

Transparency : float between 0 and 1

Fractional transparency. 0 is opaque and 1 is transparent.

PartCoordinateSystem : str

The name of the coordinate system in which the object is drawn.

UDMId : str

Unknown use. See HFSS documentation for explanation.

MaterialValue : str

Name of the material to assign to the object

SolveInside : bool

Whether to mesh the interior of the object and solve for the fields inside.

Returns :

part : str

The actual name assigned by HFSS to the part.

hycohanz.modeler3d.get_object_id_by_name(oEditor, objname)

Return the object ID of the specified part.

Note: This is NOT the inverse of get_object_name()!

hycohanz.modeler3d.get_object_name(oEditor, index)

Return the object name corresponding to the zero-based creation-order index.

Note: This is NOT the inverse of get_object_id_by_name()!

hycohanz.modeler3d.get_object_name_by_faceid(oEditor, faceid)

Return the object name corresponding to the given face ID.

hycohanz.modeler3d.get_selections(oEditor)

Get a list of the currently-selected objects in the design.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

Returns :

selectionlist : list

List of the selectable objects in the design?

hycohanz.modeler3d.imprint(oEditor, blanklist, toollist, KeepOriginals=False)

Imprint an object onto another object.

Note: This function is undocumented in the HFSS Scripting Guide.

hycohanz.modeler3d.mirror(oEditor, partlist, base, normal)

Mirror specified parts about a given base point with respect to a given plane.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

partlist : list

List of part name strings to be mirrored.

base : list

Mirror base point in Cartesian coordinates.

normal : list

Mirror plane normal in Cartesian coordinates.

Returns :

None :

hycohanz.modeler3d.move(oEditor, partlist, x, y, z, NewPartsModelFlag=u'Model')

Move specified parts.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

partlist : list

List of part name strings to be mirrored.

x : float

x displacement in Cartesian coordinates.

y : float

y displacement in Cartesian coordinates.

z : float

z displacement in Cartesian coordinates.

Returns :

None :

hycohanz.modeler3d.paste(oEditor)

Paste a design in the active project from the clipboard.

Parameters :

oEditor : pywin32 COMObject

The HFSS Editor in which to perform the operation

Returns :

pastelist : list

List of parts that are pasted

hycohanz.modeler3d.rotate(oEditor, partlist, axis, angle)

Rotate specified parts.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

partlist : list

List of part name strings to be rotated.

axis : str

Rotation axis.

angle : float

Rotation angle in radians

Returns :

None :

hycohanz.modeler3d.scale(oEditor, partlist, x, y, z)

Scale specified parts.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

partlist : list

List of part name strings to be scaled.

x : float

x scaling factor in Cartesian coordinates.

y : float

y scaling factor in Cartesian coordinates.

z : float

z scaling factor in Cartesian coordinates.

Returns :

None :

hycohanz.modeler3d.subtract(oEditor, blanklist, toollist, KeepOriginals=False)

Subtract the specified objects.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

partlist : list

List of part name strings to be subtracted.

toollist : list

List of part name strings to subtract from partlist.

KeepOriginals : bool

Whether to clone the tool parts.

Returns :

objname : str

Name of object created by the subtract operation

hycohanz.modeler3d.sweep_along_vector(oEditor, obj_name_list, x, y, z)

Sweeps the specified 1D or 2D parts along a vector.

Parameters :

oEditor : pywin32 COMObject

The HFSS editor in which the operation will be performed.

obj_name_list : list

List of part name strings to be scaled.

x : float

x component of the sweep vector.

y : float

y component of the sweep vector.

z : float

z component of the sweep vector.

Returns :

None :