FastFieldSolvers Forum
FastFieldSolvers Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 FastFieldSolvers
 FastHenry2
 Automation in Python

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Antispam question: What do MOONwalk and MOONdance have in common?
Answer:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON

 
   

T O P I C    R E V I E W
dave Posted - Sep 29 2017 : 11:44:45
Hey,

i'm trying to automate FastHenry with Python.
Any suggestion how to create a FastHenry2Object?

Can anyone provide me the FastHenry2 Automation Example Programs mentioned in the FastHenry help. I cannot find them in my install directory.

Best Regards

David
3   L A T E S T    R E P L I E S    (Newest First)
Enrico Posted - Oct 03 2019 : 01:08:32
Thanks for posting the code! Hope this will help the users.

Enrico
sdattalo Posted - Oct 03 2019 : 00:21:51
I know this thread is rather dated, but I had the a similar question about using Python to interface to FasterCap. I managed to get it working. Here's the Python equivalent script for the VBS example.

# Fastercap python example
# This is a python implementation of the Visual basic script example in
# the Fastercap automation examples
# This example has been tested with Python 3.7.0
#

import os
import win32com.client
import win32api
FasterCap = win32com.client.Dispatch("FasterCap.Document")
pathStr = os.getcwd()

s = ["sphere0.txt", "sphere1.txt", "sphere2.txt", "sphere3.txt"]

for sphere in s:
  FasterCap.Run(pathStr+"\\" +sphere +" -a0.01")

  while FasterCap.IsRunning():
    win32api.Sleep(500)

  cap = FasterCap.getCapacitance()
  print (sphere+"  Cap={}".format(cap[0][0]))


If your python script crashes for some reason, you may need to go into the Windows task manager and manually kill FasterCap.exe.
Enrico Posted - Sep 30 2017 : 20:01:02
The sample files changed position after Windows Vista, where the installation directories became protected and required admin privileges for writing into.

The online help of FastHenry still reports the old information, thanks for spotting that. The updated information is in the FastModel online help, "Installation" page:

  • Under a root directory (usually FastFieldSolvers under 'Program Files' folder in the English version of Windows, but you could have chosen a different path during installation), a structure containing the four directories FastModel, FasterCap, FastCap2 and FastHenry2. These directories contain the executable files, the help files and the licenses. Due to Windows user's policies, standard users cannot modify the content of these folders.

  • Under the 'Shared Documents' folder (in the English version of Windows XP, this usually is 'C:\Documents and Settings\All Users\Shared Documents', or in Windows Vista and Windows 7, this usually is the folder 'Public'), visible and fully accessible to all users, a root directory called "FastFieldSolvers" containing three folders FasterCap, FastCap2, FastHenry2. In these folders you'll find the samples related to the three programs. Please take some time to browse around and get accustomed with the contents.


Regarding COM Automation from Python, you need to install the Windows extensions for Python, as this technology is pretty MS Windows specific (in spite of the original intention of having a common agnostic interface). You can search the web for the instructions on how to do so.

Best Regards,
Enrico




FastFieldSolvers Forum © 2020 FastFieldSolvers S.R.L. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.06