Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
Ansys Products

Ansys Products

Discuss installation & licensing of our Ansys Teaching and Research products.

Spaceclaim Scripting – Accessing model elements smarter

    • Bjørn Hartmann
      Subscriber

      Hi,

      I am quite new to spaceclaim and spaceclaim scripting. I am trying to build a parametrized script to generate a geometry, which i think will be valuable considering the number of very similar models i build.

      However, I am having a hard time getting around selection the variables in my model (curves, points, surfaces ...) without having to use something like
      index = [GetRootPart().Curves[i].GetName() for i in range(len(GetRootPart().Curves))].index(name) and then GetRootPart().Curves[index].GetChildren[ICurvePoint]()[0]....

      Is there no direct way for me to assign a named curve for example to a parameter?
       

    • Atharv Joshi
      Forum Moderator

      Hi Hartmann, 

      You can try creating a named selection and then use the below command to set the selection.
      Curve is selected and added as a named selection Group 1.

      curve=Selection.CreateByGroups("Group1") 

      Please refer to this course on Scripting in Ansys Discovery where is covers various selection. Ansys Discovery Scripting - Access Objects | Ansys Courses

      Thanks and Regards
      Atharv

Viewing 1 reply thread
  • The topic ‘Spaceclaim Scripting – Accessing model elements smarter’ is closed to new replies.
[bingo_chatbox]