Changing parameters using scripts

azazga anis
azazga anis Altair Community Member
edited May 6 in Community Q&A

Hello team,

I am currently working with Simlab and using python scripts to edit sketches and geometries. I want to change some geometry parameters using these scripts and have some questions. Do I need to modify parameters directly in the parameters.xml file or in the python scripts? Is it possible to change the geometry only on the sketches, directly on the geometries, or on the sketches that determine the geometries?

I have tried manipulating the XML and Python files, as well as linking them together, but the parameters in Simlab do not change. Could I be missing something in this process?

Thank you in advance for your responses

Answers

  • Santhoshkumar
    Santhoshkumar
    Altair Employee
    edited May 6

    Hello,

    Please use the below function and modify the sketch parameter.

    ModifyParameters=''' <ModifyParameters UUID="4ca68ace-4163-416c-9a28-bceae4fccad9">
      <Parameter Comments="" OldName="M1_L1" Link="" Value="50 mm" Type="Length"/>
     </ModifyParameters>''';
    simlab.execute(ModifyParameters);

    Attached is the sample script for your reference.

    Note: The xml file is used only for the DOE purpose.

    Thanks & Regards,

    Santhoshkumar