Add PointRelation3d with RefPlane and Circle2d

Pioneer
Pioneer

Hi,

 

I would like to add a PointRelation3d between the xy RefPlane of a part and a Circle2d in an assembly sketch with the api. Unfortunately the Add method fails. What I did so far:

  1. Test my program with a Circle (from a hole) in another part in the main assembly instead of the Circle2d. This works. (Of course I have to create a reference to the circle object). The Circle2d is in a main assembly sketch, so I dont create a reference. I suppose that is correct.
  2. Created the Relation by hand and tried to analyse it. I can use GetElement1 and GetGeometry1. The first one returns a reference to the RefPlane in the part. GetElement2 and GetGeometry2 both fail. So I dont know what exactly the second part of the PointRelation3d is. I noticed that when you select the the Circle2d Solid Edge automatically identifies the center point of the circle and creates the relation from there. Perhaps I dont represent this behavior in my code.
  3.  I added a PlaneRelation3d between the plane of the Circle2d's profile and the RefPlane. Again I dont create a Reference to the plane as it sits in the assembly. This works.

I dont know how to proceed from here. The PointRelation is essential at this 'point'. Do you have any ideas?

 

Best regards,

Robin

4 REPLIES

Re: Add PointRelation3d with RefPlane and Circle2d

Siemens Genius Siemens Genius
Siemens Genius

Robin,

 

I haven't had a chance to try out what I am about to suggest, but this is the path I see. There are two relatively recent API methods that could help you move forward:

1. SolidEdge.Part.Interop.Profile.MapGeometryToCurves

2. SolidEdge.Part.Interop.Profile.MapPoint2dToCurveVertex

 

On the profile from the sketch, call one of the above with the 2d as input. You should get a curve or vertex that you can pass to the relation as geometry. The APIs above map from the 2d realm to corresponding 3D entities that can be used to reference the sketch elements in 3D.

 

The other part about no getting the sketch geometry back from a manually created Connect relation, may be a hole in our API and needs fixing.

 

You can raise an IR if this does not work.

 

Regards,

Aditya

---
Aditya Gurushankar
Manager, Solid Edge Planning

Re: Add PointRelation3d with RefPlane and Circle2d

Pioneer
Pioneer

Aditya, I will try this tomorrow at work. I am really excited about your suggestion.

Re: Add PointRelation3d with RefPlane and Circle2d

Pioneer
Pioneer

Yes!

 

I Have a Circle2d so I cannot use MapPoint2dToCurveVertex, but MapGeometryToCurves works like a charm. Thank you very much!

 

-Robin

Re: Add PointRelation3d with RefPlane and Circle2d

Siemens Genius Siemens Genius
Siemens Genius
Super! Glad that worked for you.

Aditya
---
Aditya Gurushankar
Manager, Solid Edge Planning