Problem with dimension creation when drawing view has break out.

Problem with dimension creation when drawing view has break out.

Hubert_Los
Advocate Advocate
392 Views
2 Replies
Message 1 of 3

Problem with dimension creation when drawing view has break out.

Hubert_Los
Advocate
Advocate

Hello,

I have a simple code that creates the dimension of a drawing view when a curve is selected. I have a problem with the line from break out, the red line on the left. On the right everything looks ok. the GeometryIntent point is the same as in the drawing, but the dimension was created lower. Why?

Hubert_Los_1-1722861964175.png

 

 

 

 

Dim drawingDocument As DrawingDocument = ThisApplication.ActiveDocument
Dim sheet As Sheet = drawingDocument.ActiveSheet
Dim drawingCurveSegment As DrawingCurveSegment = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Select line")
Dim drawingCurve As DrawingCurve = drawingCurveSegment.Parent

Dim startPoint As Point2d = drawingCurve.StartPoint
Dim endPoint As Point2d = drawingCurve.EndPoint
Dim geometryIntent1 As GeometryIntent = sheet.CreateGeometryIntent(drawingCurve, startPoint)
Dim geometryIntent2 As GeometryIntent = sheet.CreateGeometryIntent(drawingCurve, endPoint)
Dim textPoint As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(startPoint.X - 1, (startPoint.Y + endPoint.Y) / 2)

sheet.DrawingDimensions.GeneralDimensions.AddLinear(textPoint, geometryIntent1, geometryIntent2, DimensionTypeEnum.kVerticalDimensionType)

 

 



0 Likes
Accepted solutions (2)
393 Views
2 Replies
Replies (2)
Message 2 of 3

daltonNYAW9
Advocate
Advocate
Accepted solution

The curve type is likely different so you will need to change the intent type. You can test it with this:

MessageBox.Show(drawingCurve.CurveType.ToString)
0 Likes
Message 3 of 3

Hubert_Los
Advocate
Advocate
Accepted solution

No, it is the same.

I re-set Intent1 and Intent2 in the dimension, after creation. And now it works

0 Likes