News: Need training? HyperSizer Training Videos are available now! Learn more here: https://hypersizer.com/trainingevents/e-learning/

Author Topic: Creating hyperFEA loop  (Read 20144 times)

Ruben

  • *
  • Posts: 40
    •  
Creating hyperFEA loop
« on: May 04, 2016, 11:02:34 AM »
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

  • *
  • Posts: 40
    •  
Re: Creating hyperFEA loop
« Reply #1 on: May 04, 2016, 11:26:45 AM »
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

  • *
  • Posts: 40
    •  
Re: Creating hyperFEA loop
« Reply #2 on: May 04, 2016, 11:39:41 AM »
Adding project.Refresh() before project.UseUpdatedElementForces = (i!=0) seems to have sorted the problem.

Ryan

  • Administrator
  • *****
  • Posts: 145
    •  
Re: Creating hyperFEA loop
« Reply #3 on: May 04, 2016, 12:42:44 PM »
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