HyperSizer Support Forum

Software Use => Scripting => Topic started by: Tobias Bach on May 15, 2013, 04:17:31 AM

Title: Import FEM Data via COM API
Post by: Tobias Bach on May 15, 2013, 04:17:31 AM
Hey Guys,

I have a problem with the ImportFEM function in VBA.
I've set the rundeck FEM & FEA Filename to existing NASTRAN .bdf & .op2 and saved the project and used the ImportFEM function. The model is imported correctly, the Load sets are available, but the load cases are not imported.
If I perform a manual import, all data is there. Due you have any clue what's the error?

This is the code I used:
Code: [Select]
Set oProject = oHs.Projects.Item(ProjectName)
oProject.Rundecks.Item(1).FilenameFEM = "D:\HyperSizer Data\Projects\Bach\Test_Batch\dummy.bdf"
oProject.Rundecks.Item(1).FilenameFEA = "D:\HyperSizer Data\Projects\Bach\Test_Batch\dummy.op2"
Call oProject.Save
Call oProject.ImportFEM

Thanks, Tobias
Title: Re: Import FEM Data via COM API
Post by: Ryan on May 15, 2013, 07:38:20 AM
Hi Tobias,

When you import the FEM through the COM API, the load cases are not rebuilt. You will have to manage this with some extra code. I've posted some sample code that shows how to do this.

http://hypersizer.com/help/index.php#COM/Members/com-project-import_fem.php (http://hypersizer.com/help/index.php#COM/Members/com-project-import_fem.php)

-Ryan
Title: Re: Import FEM Data via COM API
Post by: Tobias Bach on May 15, 2013, 08:29:49 AM
Hi Ryan,

thanks, problem solved.

Tobias