-
-
March 17, 2025 at 8:08 pm
mhaas
SubscriberHi,
I am writing an OpenTD script in C# that I organize into methods. I want to be able to create an instance of Thermal Desktop only once for the whole namespace. Currently, in each method I have the following lines of code.
var td = new ThermalDesktop();
td.ConnectConfig.DwgPathname = dwgFilePath;
td.Connect();
where dwgFilePath is a string I input into each method. This method works, but takes a long time to connect to Thermal Desktop, and I call methods with this header hundreds of times in my scripts.
I am looking for a way to not have to redefine (and hopefully reconnect to) Thermal Desktop within each method, while still being able to use the td alias within the method. Is there a way to declare these three lines globally? When I try to declare it at the class level, I am unable to use the type var.Thank you!
-
- You must be logged in to reply to this topic.
- How do I get my hands on Ansys Rocky DEM
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- convergence issue for transonic flow
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- Point exception in erosion calculation
- Script Error Ansys
- Errors with multi-connected bodies using AQWA
-
2607
-
938
-
812
-
599
-
591
© 2025 Copyright ANSYS, Inc. All rights reserved.