Cancel
Showing results for 
Search instead for 
Did you mean: 

Get Solid Edge Edge ID from Drafting View

Creator
Creator

Hi,

I am writing a small programme, Where I am creating the PMI Dimension corresponding to Drafting Dimension.

Drafting dimension - -> Refernce edges --> PMI Dimension

 

I am not able to get the actual dimension reference edges from drafting. I am getting refernces as DVLine2d, DVArc2d etc. I want to know how can I use this to create a PMI dimension using these references.

 

I am writing code in C#.net

I am new to solid edge development. I am having experience in NX and Catia Development. 

 

Thanks in advance.

 

 

 

18 REPLIES

Re: Get Solid Edge Edge ID from Drafting View

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

The DVLine2d, etc objects have a ModelMember property which gives basic information from where the line comes from, e.g. DesignBody of PartX. You won't get more detailed information about its origin. The ModelMember object has the ModelNode.FileName property, which leads you to the source file of the line.

It is then up to you, to find the corresponding edge in the design model of that document.

NOTE: There is NO direct link between a 3D edge and DVLine2d, DVArc2d, etc objects!

Re: Get Solid Edge Edge ID from Drafting View

Creator
Creator

Thanks Martin. 

So you mean the dimension reference in the drafting does not have any direct relation to the 3d edge of a part.

is there any way I can determine the part edge to which the drafting dimensions are attached to?

 

Re: Get Solid Edge Edge ID from Drafting View

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

There is no 1:1 mapping between 3d edge and 2d line, but based on the 2d projected coordinates of the lines and the orientation of the drawing view, you may limit the possible candidate for the 3d edge associated to a specific DVLine2d.

NOTE: a DVLine2d object does NOT necessarily map to a linear edge in 3d!

Imagine a front view of a cylinder along the z-axis. The top and bottom faces are projected as horizontal lines. This type of considerations make it much more difficult to find the exact 3d edge in a part.

Re: Get Solid Edge Edge ID from Drafting View

Creator
Creator

I got it now. I will check it how I can take it forward. 

Thank you.

Re: Get Solid Edge Edge ID from Drafting View

Creator
Creator

Martin, One more doubt. 

There is one API "GetReferenceKey". can you tell what exactly it does. 

Capture.PNG

 

 

Also, See this from the actual documentation.

 

Capture.PNG

 

Re: Get Solid Edge Edge ID from Drafting View

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

The reference key of a topological entity is a byte array of unknown length, dependend on the "roadmap" from the base feature until the topology. This byte array can be used for persistency to identify topology undoubtedly between SE sessions. The method Document.BindKeyToObject gives you back the topology for a specific reference key.

 

I never used a reference key of a DV...2d object, but I believe it works the same way as in any 3d environment: a "roadmap" from the document to the 2d object and that would imply that you CANNOT bind a reference key from a 2d object to an edge in a 3d environment.

 

BUT: as I already said, I NEVER had the need to use the reference key of a DV...2d object (to be honest, I hadn't even recognized that this was added to the API)

 

WOW: I was just looking at the API doc and found the following, so you may get what you want using the reference key:

ReferenceKey.png

 

Re: Get Solid Edge Edge ID from Drafting View

Creator
Creator

What you have pointed is true. I will try to implement the logic and will keep you posted about the outcome.

Thanks.

Re: Get Solid Edge Edge ID from Drafting View

Creator
Creator

This actually worked. I got 1:1 mapping of the 2d to the 3d edge. 

Now I am reading the dimensions from Drafting and getting the edge to which it is associated. 

 

Re: Get Solid Edge Edge ID from Drafting View

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Congratulations @Alison1!

 

It's strange that I have never recognized the GetReferenceKey method on the DV...2d objects in the past.

These are the moments that I am looking for, when I try to answer the questions of other in this forum...always in search of something new to learn, and that is definitely something I didn't knew before!!

 

Although I am not using it currently in any project, I may use it one day...