Hi @dbsim4
I think it would help a lot if you could post an image depicting what you are trying to achieve.
Answering the question from the subject line: No, there is no snapping in Python (not sure how that API could look like), but there are functions to get the distance between entities (and corresponding closest points), which may help.
brick1 = XCoreModeling.CreateSolidBlock(Vec3(0), Vec3(1))
brick2 = XCoreModeling.CreateSolidBlock(Vec3(2), Vec3(3))
res = XCoreModeling.GetEntityEntityDistance(brick1, brick2)
print(f"Distance brick1-brick2: {res[0].Distance}")
print(f"Closest point on brick1: {res[0].ClosestPosition}")
print(f"Closest point on brick2: {res[1].ClosestPosition}")
or distance to a point:
brick = XCoreModeling.CreateSolidBlock(Vec3(0), Vec3(1))
res = XCoreModeling.GetEntityEntityDistance(brick, Vec3(3))
print(f"Distance brick-point: {res.Distance}")
print(f"Closest point on brick: {res.ClosestPosition}")
For geometry that has end-points or corners, you could extract the vertices and again use distance wrt some other point as a way to write a script.
edge = XCoreModeling.CreateEdge(Vec3(0), Vec3(1))
vertices = XCoreModeling.GetVertices(edge)
assert len(vertices) == 2
for v in vertices:
print(v.Position)
brick = XCoreModeling.CreateSolidBlock(Vec3(0), Vec3(1))
vertices = XCoreModeling.GetVertices(edge)
assert len(vertices) == 8