-
-
May 4, 2023 at 3:35 pm
Jake Garrison
SubscriberHello,
I have a parametric inventor model that is loaded into Spaceclaim and Modified to be 2D geometry as shown below.
Using SCDM scripting in python, how can I find the flats (edges) on the nut geometry that contact the bolt flats (edges) and create named selections for each pair. For example:
Named selections for the first thread shown above.
Named selections for the second set of threads shown above, Etc.
I can calculate the length of the flats from the pitch on the bolt and nut threads, in this case they’re 0.111" in length.
-
May 5, 2023 at 10:06 am
Aniket
Ansys Employeeyou can use PowerSelection APIs to filter all edges with the same length (note this is what it records in the script editor when I select one edge in the tree, and then from the "selection" tab choose "select edges with same length", and insert selection in the script editor):
PowerSelection.Edges.ByLength(EdgeSelection.Create(GetRootPart().Bodies[0].Edges[2]),
PowerSelectOptions(True), #true if you want to search across all bodies, false if you want to search only in the bodies[0]
SearchCriteria.SizeComparison.Equal)now you can get 2 selections for same length, you can pythonically loop in one group of edges, to find if there is another edge coincident with it:
for example:
GetRootPart().Bodies[0].Edges[3].Shape.Geometry.IsCoincident(GetRootPart().Bodies[1].Edges[0].Shape.Geometry)
-Aniket
-
May 5, 2023 at 3:03 pm
-
May 8, 2023 at 10:18 am
Aniket
Ansys Employee -
May 8, 2023 at 12:17 pm
Jake Garrison
SubscriberNo they are not coincident.
-
May 9, 2023 at 8:31 am
Aniket
Ansys EmployeeIsCoincident will only work if the edges are coincident. If they are not, you may have to try and check the bounding box of these edges and then decide this.
You can get a bounding box by:
e1=GetRootPart().Bodies[0].Edges[0]
b1=e1.Shape.GetBoundingBox(Matrix.Identity)
b1.Center
b1.corner
-Aniket
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum
-
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- How to work with STL file?
- Rotate tool in ANSYS Design Modeler
- section plane
- Using Symmetry in DesignModeler and Expanding the Results
- ANSYS FLUENT – Operation would result in non manifold bodies
- material properties
- drawing a geometry by importing a table of points
- Geometry scaling
- Coordinates orientation
- “contact pair has no element in it.” how to resolve this problem
-
5454
-
3419
-
2473
-
1310
-
1022
© 2023 Copyright ANSYS, Inc. All rights reserved.