Software Use > Scripting

Creating hyperFEA loop

(1/1)

Ruben:
Hello,

I'm trying to add a hyperFEA loop to my Python code, but it is not using the updated results. I've based my code on the following:

http://hypersizer.com/help/index.php#COM/HyperFea/com-hfea-overview.php

I've also tried using your hyperfea.xls example on my database, and I get the same result, the mass remains constant after each loop, as it is not using the updated FEM.

In my code I have:

project.UseUpdatedElementForces = (i != 0)
project.Save()

If I go into the database, Use Original is selected and Use Updated is not greyed out, just not selected. Can you confirm that your hyperfea.py script still works with HS 7.1 on one of your databases?

If I use HyperFEA from within Hypersizer, the updated FEM is correctly used and the mass decreases with each loop.

One last question, is it possible to create a new database from the COM interface and select a default database? Currently I just create a new database manually, then run the Python script on that hdb.

Regards,
Ruben


Ruben:
If I take control of the database outside of my script and use project.UseUpdatedElementForces=True and then project.Save(), it does change the FEA results file, for some reason it is not working from within the script.

Ruben:
Adding project.Refresh() before project.UseUpdatedElementForces = (i!=0) seems to have sorted the problem.

Ryan:
Hi Ruben,

There is an issue with project.RunDecks that affects the next project.Save() call.

Like you suggested, calling project.Refresh() before modifying the "UseUpdateElementForces" property provides a workaround for this issue.

For your second question, there's no way to create database via scripting. I would create a default database manually, and then in the script copy default database to a temporary 'working' database (shutil.copyfile).

Thanks,
Ryan

Navigation

[0] Message Index

Go to full version