Personal tools
You are here: Home Forum Use Re: About developing a parametric PY script from imported Geometry file

Re: About developing a parametric PY script from imported Geometry file

Up to Use

Re: About developing a parametric PY script from imported Geometry file

Posted by Ahmed Hesham at August 25. 2018

Dear all,

I have an iges geometry file of a honeycomb. I want to create a parametric  python script to be able to change honeycomb size. When I saved it as dump study to create a PY script, it was saved without giving a parametric model. How can I get a parametric script that truly describe the honeycomb shown in the photo attached??

Below is the PY code that was generated:
### This file is generated automatically by SALOME v8.4.0 with dump python functionality
###
import sys
import salome
salome.salome_init()
theStudy = salome.myStudy
import salome_notebook
notebook = salome_notebook.NoteBook(theStudy)
sys.path.insert( 0, r'/home/ahmed/Training')
### GEOM component
import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS
geompy = geomBuilder.New(theStudy)
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
HONEYCOMB_4MM_8X8_TRUE_STL_1 = geompy.ImportSTL("/home/ahmed/Downloads/HONEYCOMB 4MM 8X8 TRUE.STL" )
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy( HONEYCOMB_4MM_8X8_TRUE_STL_1, 'HONEYCOMB 4MM 8X8 TRUE.STL_1' )
if salome.sg.hasDesktop():
  salome.sg.updateObjBrowser(True)

 

 

Attachments
Powered by Ploneboard
Document Actions