Unspecifed error in AddLinear

Unspecifed error in AddLinear

Anonymous
Not applicable
604 Views
4 Replies
Message 1 of 5

Unspecifed error in AddLinear

Anonymous
Not applicable
Hi friends,

I have implement following code(C#) to add linear dimension.But after execution, "Unspecifed error " message occured at AddLinear API. Can you please tell me what is the problem with code.

Point2d stPoint1 = m_inventorApp.TransientGeometry.CreatePoint2d(45.6113, 16.015);
Point2d endPoint1 = m_inventorApp.TransientGeometry.CreatePoint2d(45.6113, 18.515);

GeometryIntent top1 = oSheet.CreateGeometryIntent(endPoint1, PointIntentEnum.kEndPointIntent);
GeometryIntent bottom1 = oSheet.CreateGeometryIntent(stPoint1, PointIntentEnum.kStartPointIntent);

Inventor.DimensionStyle oDimStyle = m_inventorDrawingDoc.StylesManager.DimensionStyles[3];
Inventor.Layer oDimLayer = m_inventorDrawingDoc.StylesManager.Layers[21];

oSheet.DrawingDimensions.GeneralDimensions.AddLinear(endPoint1, top1, bottom1, DimensionTypeEnum.kVerticalDimensionType, true, oDimStyle, oDimLayer);

Thanks in Advance

Satyajeet
0 Likes
605 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

Hi Satyajeet,

 

You shouldn't create the GeometryIntent using the
Point2d object as Geometry parameter. Valid input can be DrawingCurve.

 

Thanks,

-Lisa


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi
friends,

I have implement following code(C#) to add linear
dimension.But after execution, "Unspecifed error " message occured at
AddLinear API. Can you please tell me what is the problem with code.


Point2d stPoint1 =
m_inventorApp.TransientGeometry.CreatePoint2d(45.6113, 16.015);
Point2d
endPoint1 = m_inventorApp.TransientGeometry.CreatePoint2d(45.6113,
18.515);

GeometryIntent top1 =
oSheet.CreateGeometryIntent(endPoint1, PointIntentEnum.kEndPointIntent);

GeometryIntent bottom1 = oSheet.CreateGeometryIntent(stPoint1,
PointIntentEnum.kStartPointIntent);


Inventor.DimensionStyle
oDimStyle = m_inventorDrawingDoc.StylesManager.DimensionStyles[3];

Inventor.Layer oDimLayer = m_inventorDrawingDoc.StylesManager.Layers[21];


oSheet.DrawingDimensions.GeneralDimensions.AddLinear(endPoint1, top1,
bottom1, DimensionTypeEnum.kVerticalDimensionType, true, oDimStyle,
oDimLayer);

Thanks in
Advance

Satyajeet
0 Likes
Message 3 of 5

Anonymous
Not applicable
Hi Lisa,
Thanks for fast reply.
But how should i take curve from "Drawing View" ?

Thanks & Regards,
Satyajeet
0 Likes
Message 4 of 5

Anonymous
Not applicable
I got the answer.

By following code, i will get drawingcurves from which i need find out my curves.

DrawingCurvesEnumerator s1 = (DrawingCurvesEnumerator)oBaseView.get_DrawingCurves(null);

Satyajeet

Message 5 of 5

C-Hoppen
Advocate
Advocate

You just made my day. Smiley Very Happy I was wondering about get_DrawingCurves(Object ModelObject). It's c# related and not documented.

0 Likes