ansys / pyedb-core

Ansys Electronics Database Python Client Package
https://edb.core.docs.pyansys.com/
MIT License
4 stars 2 forks source link

BUG: can't assign parameter on primitive setter #432

Closed svandenb-dev closed 1 month ago

svandenb-dev commented 1 month ago

🔍 Before submitting the issue

🐞 Description of the bug

I can define properly a design variable cell.add_variable(name="my_variable", value=Value("100um"), is_param=True)

But I can't assign this variable to a path.width: path.width = Value("my_variable") path.width = "my_variable"

I found that even if is_param = True the variable is always defined as non parametric which could be the reason ?

image

📝 Steps to reproduce

NA

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

NA

🐍 Which Python version are you using?

3.10

📦 Installed packages

NA
drewm102 commented 1 month ago

@svandenb-dev For Value objects that are parameterized, the Value constructor also requires the variable owner (in this case cell) so that it can resolve the value of the variable. So, if you construct the Value like this it should work:

cell.add_variable(name="my_variable", value=Value("100um"), is_param=True)
path.width = Value("my_variable", cell)
svandenb-dev commented 1 month ago

I confirm it is working