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

Author Topic: Switching Assembly Analysis Modes using COM  (Read 18537 times)

bjohnson63

  • Client
  • **
  • Posts: 8
    •  
Switching Assembly Analysis Modes using COM
« on: April 25, 2016, 04:04:36 PM »
Hello,

In my MATLAB script for HyperFEA I am in need of switching between Detailed Sizing and Final Analysis at various points within an iteration. But switching from detailed to final analysis using Assembly.AnalysisMode = 1 followed by Assembly.Size throws in an error. I've opened up the HS gui and noticed the above commands cause all the component dimensions to disappear in that assembly. This must be the reason for the error.

But when I use the gui to switch the analysis mode from detailed to final the component dimensions are set to the last results of the detailed analysis. Thus I am able to size the assembly just fine.

What would cause the switch to work in the gui but not using COM, and is there a way to avoid this error using COM?

Thanks,

Brandon

Ryan

  • Administrator
  • *****
  • Posts: 145
    •  
Re: Switching Assembly Analysis Modes using COM
« Reply #1 on: April 26, 2016, 11:06:56 AM »
Hi Brandon,

The scripting API does not include this behavior.

Detailed sizing variables and analysis values are stored separately. When you change analysis modes you can using the API to copy the results of the previous detailing sizing run to the analysis values.

I've attached a Python script showing how this works.

Thanks,
Ryan

bjohnson63

  • Client
  • **
  • Posts: 8
    •  
Re: Switching Assembly Analysis Modes using COM
« Reply #2 on: April 26, 2016, 07:56:20 PM »
Thanks! I think I found a way around this though by using Group.FreezeDesign=1 then running the detailed sizing. This way I can get margin results with updated FEA loads without changing the design.

Best,

Brandon