Constraining sketch points on vertices, construction points or even edges of bodies

Constraining sketch points on vertices, construction points or even edges of bodies

peter.pant
Participant Participant
347 Views
1 Reply
Message 1 of 2

Constraining sketch points on vertices, construction points or even edges of bodies

peter.pant
Participant
Participant

Hello everybody,

 

I am quite new in using the API and I have the following question: I have already imported a component from a STEP-File and I would like to create a sketch and constrain its points on the vertices or edges of the imported body. It is something that I am able to do manually using the ui, but I can't come around using the api. Any help or hints are really welcome!

 

Thanks in advance!

0 Likes
Accepted solutions (1)
348 Views
1 Reply
Reply (1)
Message 2 of 2

BrianEkins
Mentor
Mentor
Accepted solution

When you use the UI in a sketch, it does some extra work that's not apparent unless you do some additional investigation. In this case, when you create a sketch on a planar face, the default is to automatically project the edges of the face into the sketch as sketch geometry. They aren't displayed unless you move the mouse over them. When you create new sketch geometry and dimension to a "vertex" you're not dimensioning to the vertex but instead are using the sketch point that was created when the face was projected onto the sketch.

 

When creating a new sketch using the API and providing a planar face as input, you can use either the add or addWithoutEdges methods. The add method will project the face into the new sketch but he addWithoutEdges does not. In the API, it's usually easiest to use the addWithoutEdges and then project the items you want. This is easier than querying all of the geometry in the sketch to find what you want.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com