Personal tools
You are here: Home Forum Use How to activate the visibility of the objects with Python script ?

How to activate the visibility of the objects with Python script ?

Up to Use

How to activate the visibility of the objects with Python script ?

Posted by Loratorien at May 13. 2016

Hi,

There was some evolutions in Salome that make an object invisible if I use only "geompy.addToStudy". Now  there is something else to do to be able to see directly the objects as before. Can someone explains me what I have to do ?

Sincerely.

Pascal KREZEL

Re: How to activate the visibility of the objects with Python script ?

Posted by Saint Michael at May 13. 2016

Hi Pascal

AFAIK nothing changed about "geompy.addToStudy". Probably you just need to update the Object Browser to see the result of addToStudy():

if salome.sg.hasDesktop():
  salome.sg.updateObjBrowser(1)

St.Michael

Re: How to activate the visibility of the objects with Python script ?

Posted by Loratorien at May 13. 2016

Hi St.Michael,

 

Thank you for your answer.

 

I found the problem : if you launch your script from the "load script"  when you activate the geometry module, you make the objects invisible but if you activate the geometry module and then you load your script it works.

 

I thought that it was the same but it is not.

 

Sincerely.

 

Pascal KREZEL

 

 

 

Re: How to activate the visibility of the objects with Python script ?

Posted by Leon Kos at March 13. 2018

I am also wondering how to activate module with the script?

Using LCC does not help.

Re: How to activate the visibility of the objects with Python script ?

Posted by Roman NIKOLAEV at March 14. 2018

Hello Pascal

To activate a module use the following set of commands:

import SalomePyQt
sg = SalomePyQt.SalomePyQt()
sg.activateModule('Module_Name')

Module_Name is 'Geometry', 'Mesh', ...

Re: How to activate the visibility of the objects with Python script ?

Posted by owzz at August 14. 2018

Hi roman,

But I want to open hdf file or mesh file with the geometry module or with mesh module.

How I can do that?

Powered by Ploneboard
Document Actions