FunctionBuilder¶
Call a user-defined Python function to build or modify the HFSS model.
This builder is highly flexible and useful for dynamic setups.
Bases: BaseBuilder
Builder that delegates logic to a user-defined Python function.
This builder is highly flexible and useful when programmatic or external control over the build process is needed.
The user-supplied function must have the following signature:
def my_builder_function(hfss: Hfss, **kwargs) -> dict:
...
hfss
: The active HFSS session object.**kwargs
: Arbitrary keyword arguments, typically containing build parameters.- The function must return a dictionary with any results or output parameters.
Example
Attributes:
Name | Type | Description |
---|---|---|
type |
Literal['function_builder']
|
Identifier for this builder type. |
function |
Callable[[Hfss, ...], dict]
|
Callable object (excluded from serialization). |
args |
dict
|
Static arguments passed to the function at runtime. |
build ¶
Call the user-defined function with merged arguments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hfss
|
Hfss
|
Active HFSS session. |
required |
parameters
|
dict | None
|
Optional runtime parameters. These are merged with |
None
|
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
Output of the user-defined function. |
Raises:
Type | Description |
---|---|
Exception
|
Any exception raised by the user-supplied function will propagate up. |