General Mechanical

General Mechanical

How do I create a ‘for loop’ in ACT console?

    • HAN

      Hi all,

      I want to create a for loop so that I can load different .igs files automatically, but I couldn't do for loop in ACT console. Does anyone know how to do it?

      Here is my code:



      for ( num = 0; num < 2; num++)


        file(num)="D://Solidworks//Ocean buoy//Configuration//test1_20200915_1.igs"

      template1 = GetTemplate(

        TemplateName="Hydrodynamic Diffraction",


      system1 = GetSystem(Name="AQW")

      system2 = template1.CreateSystem(



      geometry1 = system2.GetContainer(ComponentName="Geometry")




    • Aniket
      Ansys Employee
      debugging user scripts does not come under support scope for Ansys employees on learning forum I hope others can chime in here.
      Just to give you hint, Ansys workbench uses ironpython so search "python for loop" to get correct syntax.
      You are not using correct syntax. I hope that helps.
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum
Viewing 1 reply thread
  • You must be logged in to reply to this topic.