3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

Need help creating selection in Space Claim from layer [SCRIPTING]

    • Adrian Sieradzki
      Subscriber

      Hello,

      Does anyone know how I can programatically select an entire layer (either by its name or index) to make selectom similar to Selecton.Create()?

      I am new to space claim scripting and recorder does not seem to output anything when I select something in editor so - does someone have a link to resource where I can learn more about API or does someone know already how to select a specific layer?

      Thanks

    • Adrian Sieradzki
      Subscriber

      Okay I made some good progress:

      1. The documentation is located in ansys installation directory in 'scdm' folder (its actually not bad)
      2. There is no way to access objects from the layer, instead all objects that "belong" to a layer will be implementing IHasLayer interface, the name of layer property can be checked without casting:

      myLayerName = r"solid"
       
      obs = DocumentHelper.GetAllDocObjects()
       
      for obj in obs:
          if obj.Layer.Name == myLayerName:
              #your code here
       



      Let me know if you have a better way 




Viewing 1 reply thread
  • You must be logged in to reply to this topic.