Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set value in in connection to application #2243

Open
pvalle6 opened this issue Apr 12, 2024 · 0 comments
Open

Unable to set value in in connection to application #2243

pvalle6 opened this issue Apr 12, 2024 · 0 comments

Comments

@pvalle6
Copy link

pvalle6 commented Apr 12, 2024

For all bugs, please provide the following information:

Expected behavior and actual behavior

It should change the value (which can be confirmed in the connected program) and confirmed by
simulation.flow_sheet.Operations.Item("TIC-100").SP.Value

The actual behavior is an error. Which is literally littered all over the internet and no good solutions are posted in 99.9% of stackoverflow and the solutions that do exist are often not working.

Steps to reproduce the problem

  1. Load Aspen HYSYS File using Aspen_HYSYS_Python
import win32com.client as win32
simulation_name = aspen_hysys_file
aspen = win32.DispatchEx('Hysys.Application')
simulation = self.aspen.SimulationCases.Open(os.path.abspath(simulation_name))
self.act_doc = self.aspen.activeDocument
self.flow_sheet = self.act_doc.Flowsheet
simulation.flow_sheet.Operations.Item("TIC-100").SP.setValue(-32, "C")

System information

Python version and distribution: Python 3.10

pywin32 version: v306

Installed from PyPI or exe installer: Yes

Windows Version:
Version 10.0.19045 Build 19045

DLL locations:

C:\Users\username\PyCharm Projects\project_directory.venv\lib\site-packages\pywin32_system32\pywintypes310.dll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant