Personal tools
You are here: Home Forum Use How to open multiples .hdf files with py script and get geometries?

How to open multiples .hdf files with py script and get geometries?

Up to Use

How to open multiples .hdf files with py script and get geometries?

Posted by Daniel RF at July 01. 2017

Hi, evebody!

Is it possible open multiples .hdf files in only script and get differents geometries?

I try it, but don't work:

salome.salome_init("myfile_1.hdf")
study = salome.myStudy.FindObject("thestudy")
study = salome.myStudy

import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS

geompy = geomBuilder.New(study)
geomObj = salome.myStudy.FindObjectByName("box_1", "GEOM")
box_1 = geomObj[0].GetObject()

salome.salome_init("myfile_2.hdf")
study = salome.myStudy.FindObject("theStudy")
study = salome.myStudy

geompy = geomBuilder.New(study)
geomObj[0] = salome.myStudy.FindObjectByName("box_2", "GEOM")
box_2 = geomObj[0].GetObject()

Error: AttributeError: 'list' object has no attribute 'GetObject'

Regards.

Daniel RF

Re: How to open multiples .hdf files with py script and get geometries?

Posted by Saint Michael at July 24. 2017

Hi

I think it's not possible, since only one study can be active.

St.Michael

Powered by Ploneboard
Document Actions