
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been trying to create a LinearGeneralDimension on an IDW from one Workpoint to another.
It crashes when i call the .AddLinear, anybody got this to work?
Here is my code snipit.
Inventor.DrawingView dv = FindDrawingViewInSheetByName(sheet, "VIEW12");
if (null != dv)
{
Inventor.WorkPoint p1 = FindWorkPointInAssemblyByName(dv.ReferencedDocumentDescriptor.ReferencedDocument as Inventor.AssemblyDocument, "MR1");
Inventor.WorkPoint p2 = FindWorkPointInAssemblyByName(dv.ReferencedDocumentDescriptor.ReferencedDocument as Inventor.AssemblyDocument, "MR2");
if (null != p1 && null != p2)
{
Inventor.GeometryIntent gi1 = sheet.CreateGeometryIntent(p1, Inventor.PointIntentEnum.kStartPointIntent);
Inventor.GeometryIntent gi2 = sheet.CreateGeometryIntent(p2, Inventor.PointIntentEnum.kEndPointIntent);
//Inventor.Point2d textPoint = m_application.TransientGeometry.CreatePoint2d(p1.Point.X - 0.25f, (p1.Point.Y + p2.Point.Y) / 2);
Inventor.Point2d textPoint = m_application.TransientGeometry.CreatePoint2d(sheet.Width/2, sheet.Height/2);
Inventor.DimensionStyle st = GetStyleByName(ddoc, "Default - Fraction (ANSI)");
Inventor.Layer layer = GetDimensionLayer(ddoc);
sheet.DrawingDimensions.GeneralDimensions.AddLinear(textPoint, gi1, gi2, Inventor.DimensionTypeEnum.kDiametricDimensionType, true, st, layer);
}
}
Thanks for any insite on this.
-Doug
Solved! Go to Solution.