Cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with AddDistanceBetweenObjects in Drawing View

Valued Contributor
Valued Contributor

Hi All,

 

Basically I'm trying to add dimensions in the drawing views.

For this i'm getting the object of two lines that I need and passing them as reference in the "AddDistanceBetweenObjects" method, but still I'm not able to get the desired result.

 

Below is the picture of the result that I'm getting if I'm taking top and bottom line.

 

Error.PNG

 

This is the result that I'm expecting.

 

Correct.PNG

 

The dimension is showing as the length of those two lines instead of distance between them.

I might be doing some small error somewhere and i'm not able to figure it out.

 

Can anyone please help me out on this?

 

Thanks in advance.

1 REPLY 1

Re: Issue with AddDistanceBetweenObjects in Drawing View

Valued Contributor
Valued Contributor

Hi All, 

 

So I figured it out.

 

I had to use the below code:

 

dimension.MeasurementAxisEx = SolidEdgeFrameworkSupport.DimAxisModeConstants.igDimAxisModeDefault;
dimension.MeasurementAxisDirection = true;

 

"igDimAxisModeDefault" is for when you want the dimension to Correspond to Horizontal/Vertical.

 

There are other modes also available like "igDimAxisModeImplied" which Corresponds to By Two Points.

 

You can change the mode as per the requirements.

 

Hope this helps if someone has the same issue.

 

Cheers!