Python Parametrization

before
after

Here is how to change parameters of an object in Salome using Python program language.

Create a simple object with specific dimensions
Go to "Dump Study" and save in .py
Open .py file and find the dimensions of the object.
Create new dimensions for the object.
(Example below:)

r=5
h=120
r2=46
h2=112

Cylinder_2 = geompy.MakeCylinderRH(r, h)

Cylinder_1 = geompy.MakeCylinderRH(r2, h2)

Create new file in Salome (geometry) and go to "Load Study".

Result: the object should now have the new dimensions entered in Python.



 

Comments

Popular posts from this blog