3D Design

3D Design

Topics related to Ansys Discovery and Ansys SpaceClaim.

SCDM Scripting PowerSelection not working as expected

    • alrifai
      Subscriber

      Hello, 

      I am simply trying to select some edges less than a threshold via the PowerSelection command. 

      First, I try by recording a macro that is when I select an edge manually, and then execute the powerSelection tool, which works fine (Line 82 and geometry as shown in the screenshot).

      In line 83, I rewrite the same line but instead use a length as a criteria, which can be used as an argument according to API documentation. But then it doesn't work. I tried by entering just 10 instead of "MM(10)" but it still doesn't seem to work. 

      Can anyone shed any light as to what might be going wrong here?

      Thank you!All the edges measuring less than 10mm are extruded by line 82 but not line 83

    • Atharv Joshi
      Forum Moderator

      Hi Yasser,

      Let me check and get back to you. 

      Thanks and Regards
      Atharv

    • Atharv Joshi
      Forum Moderator

      Hi Yasser, 

      The script should work by defining the length of the edge. Please refer to the attached screenshot. 

      Do you get invalid or deleted selection error? 
      Try changing the value MM(10) to the measured length of Edge1.  

      Thanks and Regards
      Atharv

       

    • alrifai
      Subscriber

      Hello, 

      The PowerSelection tool now seems to be working but not because of the solution that you provided. It even works when you don't define the length as a variable. The problem seemed to be with PowerSelectOptions(False). The command works when I set it to True.

      I came across this on another post, in which one of your colleague explains that keeping it False only filters the edges in the current body and NOT all the bodies. But since I only have 1 body, I don't understand how should it matter if I select 1 body(False option) or all the bodies(True option)?

      And yes you're right, whenever I faced issue earlier, it threw up an error saying "deleted section".

      On other note, 1. I wanted to select some curves from a specific area. I know I can do it perhaps through using FilterByBoundingBox perhaps. But can we define a custom shape? Elliptical or a disc area?

    • Atharv Joshi
      Forum Moderator

      Hello Yasser, 

      If you refer to my screenshot, I have used PowerSelectOptions(True) and the solution highlights PowerSelection works with length as criteria and 2 ways you can implement with/without variable. 

      Edge1 in line 82 of your code represents the edge selection and thus it can refer to the all edges within that body and script works even with PowerSelectOptions(False). 

      When we define length we have a empty selection and so basically no body to search for edges. That’s why it makes sense to set PowerSelectOptions(True) and search for all bodies even if you have single body. 

      Thanks and Regards
      Atharv

    • Atharv Joshi
      Forum Moderator

      You can use FilterByBoundingBox for the selection. I don't think its possible but will confirm if custom shapes can be used for the BoundingBox and let you know. 

      Thanks and Regards
      Atharv

    • alrifai
      Subscriber

      Sure Atharv!

      Also, thanks for the explanation That makes sense!

    • alrifai
      Subscriber

      Hi Atharv, was just following up with you to see if you got time to check if custom shapes could be used as BoundingBox for filtering edges/faces?

      Thanks!

    • Atharv Joshi
      Forum Moderator

      Hi Yasser, its not possible to use custom shapes for PowerSelect using BoundingBox. 

Viewing 8 reply threads
  • The topic ‘SCDM Scripting PowerSelection not working as expected’ is closed to new replies.