Move the start points of dimension line

Move the start points of dimension line

artemijs.nille
Contributor Contributor
569 Views
2 Replies
Message 1 of 3

Move the start points of dimension line

artemijs.nille
Contributor
Contributor

How to control the positioning of dimension lines.

In the picture below you see that, dimension lines go through the hole part.

I would like to have them on the top of the view.

How can i move them by iLogic?

or how can i place them correctly during the creation?

currently i use a following code to create a dimension

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Blatt:1")
Dim Schnittansicht = Sheet_1.DrawingViews.ItemByName("B")
Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions

Dim DSUnten = Schnittansicht.GetIntent("Sheet Metal (mm):2","AussenDFlacheDSUnten")
Dim DSOben = Schnittansicht.GetIntent("Sheet Metal (mm):2", "AussenDFlacheDSOben")

Dim DickeDS = genDims.AddLinear("DickeDS", Schnittansicht.SheetPoint(0.7, 1.1), DSUnten, DSOben)

 

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

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

The position where dimension line starts is defined by the geometry intent. If you use the simple iLogic way the Intent point is defined somewhere on one drawingcurve of your named entity. You can specify the typ of intent you want. As your component has more then one drawing curve, you would also need to define somehow, which drawingcurve to use. The sample below gets the drawingcurve nearest to the planned position of dimension text. In my test the PointIntentEnums kStartPointIntent and kEndPointIntent returns the desired points. I don't know how Inventor defines which side of a drawing curve is start or end.

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Blatt:1")
Dim Schnittansicht = Sheet_1.DrawingViews.ItemByName("B")
Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions

Dim DSUnten = Schnittansicht.GetIntent("Sheet Metal (mm):2","AussenDFlacheDSUnten",PointIntentEnum.kStartPointIntent,Schnittansicht.SheetPoint(0.7, 1.1))
Dim DSOben = Schnittansicht.GetIntent("Sheet Metal (mm):2", "AussenDFlacheDSOben",PointIntentEnum.kEndPointIntent,Schnittansicht.SheetPoint(0.7, 1.1))

Dim DickeDS = genDims.AddLinear("DickeDS", Schnittansicht.SheetPoint(0.7, 1.1), DSUnten, DSOben)

 

The sample above works for this one situation. You need a more universal workflow.

I think you need to:

- find all drawingcurves corresponding your named geometry

- compare start and end point to find the point of the drawingcurve with the highest Y value

- check if this point is start- or endpoint of the drawingcurve

- create a geometry intent with this point and the drawingcurve using the Sheet.CreateGeometryIntent method

 

I would also not use such a position of your dimension text. If you got the X,Y values of the points where your dimension lines are anchored, you can calculate a point relative to this points. E.g. DimensionText.X=(Point1.X+Point2.X)/2 and if Point1.Y >= Point2.Y then DimensionText.Y=Point1.Y+1 else DimensionText.Y=Point2.Y+1


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 3

artemijs.nille
Contributor
Contributor

Thank you

0 Likes