3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

NamedSelection in SpaceClaim Script

    • Nicole Pan Tavares
      Subscriber

      Hello! I'm having trouble creating NamedSelection via SpaceClaim Script, but I'll leave my question in parts.

      This is a slice of my geometry, in which you can see an entrance and an exit. The problem is that I need to name them before moving on to meshing, which will also be done via code. 
      The first problem is that I don't know how to select these regions. I can't use “FilterByArea” because the input and output areas are the same. I'm trying to do it via “FilterByBoundingBox” and it didn't work, and “FIlterByBoundingSphere” even works, but it's selecting the whole solid. How could I select only that surface from the input and output it in a generalized way in the code?
      This is because my geometry is scalable, so everything has to be parameterized, so I want a form of selection that depends either on the region or on the geometric parameters. 

    • Nicole Pan Tavares
      Subscriber

      This is the current code for creating this selection, but in this case, it is selecting the entire solid, which is not wanted. 

      '' 

      center_point = Point.Create(MM(0), MM(3), MM(0))
      r_test = MM(1)

      #BoundingBox = Box.Create(min_point, max_point)
      comp = Selection.Create(GetRootPart())

      #filtered_faces = faces.FilterByBoundingBox(BoundingBox)
      faces = comp.ConvertToFaces()
      filtered_faces = faces.FilterByBoundingSphere(center_point, r_inlet)

      filtered_faces.CreateAGroup('Inlet_Test')


      "

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