3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

Discovery live Python script : need help

    • seghier
      Subscriber

      Hello, i create a python script to change box height, but the problem that the solver always use the original height.

      How i can solve that?

      Please check the video attached

      import SpaceClaim.Api.V20 as spc

      import time

      starttime = time.time() 

      num = [5,3,2,4,8] 

      values = []

      i = 0

      t = 5

      face = GetRootPart().Bodies[0].Faces[5] 

      H = face.EvalMid().Point.Z*1000 

      for x, y in zip(num[0::], num[1::]):

        values.append(y-x)

      values.insert(0,num[0])

      values.insert(len(values),-num[-1])

      spc.Unsupported.Live.Solver.Start() 

      while i

        time_ = t-((time.time() - starttime) % t)

        time.sleep(time_)

        i = i+1   

        selection = Selection.Create(face)

        options = ExtrudeFaceOptions()

        options.ExtrudeType = ExtrudeType.Cut

        result = ExtrudeFaces.Execute(selection, MM(values[i-1]), options, Info1)

        spc.Unsupported.Live.Solver.Reset()

      spc.Unsupported.Live.Solver.Pause()


    • Aniket
      Forum Moderator
      Ansys staff can not download any files on the forum, so if you want to reach a larger audience to get answers from, please insert inline images describing your problem.
      -Aniket
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum
    • seghier
      Subscriber
      Can the forum developers make the videos attached visible automatically so Ansys staff don't need download them?



Viewing 2 reply threads
  • The topic ‘Discovery live Python script : need help’ is closed to new replies.