Query regarding dimension location for circle in sketch

Query regarding dimension location for circle in sketch

Anonymous
Not applicable
386 Views
1 Reply
Message 1 of 2

Query regarding dimension location for circle in sketch

Anonymous
Not applicable

Hi,

 

I am trying to apply dimension constraint for circle to add the radius dimension.

I have given the dimension location text point as input, but it doesn't take input location point to place the dimension and places the dimension at the center of circle. Please see the attached snap "CircleWithRadius.png".

 

Here is the sample code:

 

//===============================

CComPtr<Point2d> point2D;
TransientGeometry::CreatePoint2d(5, 5, &point2D);
CComPtr<SketchPoint> sketchPoint = SketchPoints::MethodAdd(point2D, FALSE);
CComPtr<SketchCircle> sketchCircle = SketchCircles::MethodAddByCenterRadius(sketchPoint, 3);

CComPtr<Point2d> textPt;
TransientGeometry::CreatePoint2d(8, 5, &textPt);
CComQIPtr<SketchEntity> sketchEntity(sketchCircle);
CComPtr<RadiusDimConstraint>radiusDimConstraint;
DimensionConstraints::AddRadius(sketchEntity, textPt, FALSE, &radiusDimConstraint);

//===============================

 

Please let me know, what is the conflict? Why the circle entity always place the radius at the center of circle?

 

Thanks in advance!!!

0 Likes
387 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

This is a quick reproduction of your code provided.

i've noticed point 8,5 also doesn't work for me, instead i used other coord then 5, that worked fine.

It does the trick for me

 

Sub test()
Dim oTransGeom As TransientGeometry
Set oTransGeom = ThisApplication.TransientGeometry

Dim oCoord1, oCoord2 As Point2d
Set oCoord1 = oTransGeom.CreatePoint2d(0, 0)
Set oCoord2 = oTransGeom.CreatePoint2d(15, 15)

Dim oSketch As PlanarSketch
Set oSketch = ThisApplication.ActiveEditObject

Dim oCircle As SketchCircle
Set oCircle = oSketch.SketchCircles.AddByCenterRadius(oCoord1, 10)

Call oSketch.DimensionConstraints.AddRadius(oCircle, oCoord2, False)
End Sub

0 Likes