Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unspecifed error in AddLinear

4 REPLIES 4
Reply
Message 1 of 5
satyajeet
451 Views, 4 Replies

Unspecifed error in AddLinear

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
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: satyajeet


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
Message 3 of 5
satyajeet
in reply to: satyajeet

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

Thanks & Regards,
Satyajeet
Message 4 of 5
satyajeet
in reply to: satyajeet

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
in reply to: satyajeet

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report