Change the position of an angular dimension

Change the position of an angular dimension

ysbaodnj
Enthusiast Enthusiast
499 Views
2 Replies
Message 1 of 3

Change the position of an angular dimension

ysbaodnj
Enthusiast
Enthusiast

I succeeded in expressing the angular dimension using the code below. But I can't move the location.

I want to show the angular dimensions inward in the picture below.

oAgIntent1,2,3 are work points.

'Dim AgLocation As Point2d = oTG5.CreatePoint2d(view3.Center.X, view3.Center.Y - 3)
and applied it, but it gives an error.

 

Dim view3 = Sheet_1.DrawingViews.ItemByName("BaseView3")
	Dim oDimStyle As Inventor.DimensionStyle = oStylesMgr.DimensionStyles.Item("일반")
	oAgIntent1 = view3.GetIntent("AG1-1")
	oAgIntent2 = view3.GetIntent("AG1-2")
	oAgIntent3 = view3.GetIntent("AG1-3")
	Dim oAgDimension = Sheet_1.DrawingDimensions.GeneralDimensions
	dimAngle = oAgDimension.AddAngular("angle", view3.Center , oAgIntent1, oAgIntent2, oAgIntent3, , , , oDimStyle)

ysbaodnj_0-1689818872232.png

 

 

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

WCrihfield
Mentor
Mentor

Hi @ysbaodnj.  The second piece of data that the AddAngular method requires as input (labeled "textOrigin") must be understood as a AngularDimensionTextPositionSpec type object.  Specifying one of these requires something known as a DocumentUnitsPoint2d type object.  This uses the 'document units' to specify the location of the point, instead of database units (centimeters).  The IManagedDrawingView.Center property returns an object of that needed type (DocumentUnitsPoint2D), but the TransientGeometry.CreatePoint2D() method creates a regular Point2D object, which is the wrong type, and will not be accepted there.  Another simple way to create custom DocumentUnits type geometry objects is though the ThisDoc.Geometry route (returns IGeometry object).  Then the IGeometry.Point2D method can be used to create a custom DocumentUnitsPoint2D object.

Dim TxtPos As DocumentUnitsPoint2d = ThisDoc.Geometry.Point2d(0,0)

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution
0 Likes