- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
With the addition of named geometry, I thought it would be nice to be able to use named faces to create automatic dimensions in an idw, potentially as a cleaner or more robust alternative to using work points.
Below is some code I am having difficulty with, I am trying to get the drawing curve that corresponds to the named face, when looking at it in a side view and then dimension using the extents of the line as my dimension points, see attached screenshot. My end goal is to dimension a named face in a section view.
My curve0 count is returning 1 so it seems to be finding a drawing curve but I cannot generate a dimension of it.
i am getting an error on the last line when trying to create the actual dimension.
Is this possible to dimension to a face?
Dim partDoc As PartDocument = ThisDoc.ModelDocument Dim namedEntities = iLogicVb.Automation.GetNamedEntities(partDoc) Dim face0 As Face = namedEntities.FindEntity("Face0") Dim oSheet = ThisDoc.Document.ActiveSheet Dim oView As DrawingView = ActiveSheet.View("VIEW1").View Dim curve0 As DrawingCurvesEnumerator curve0 = oView.DrawingCurves(face0) Dim finalCurve As DrawingCurve MessageBox.Show(curve0.Count.ToString) finalCurve = curve0.Item(1) 'MessageBox.Show(finalCurve.ToString) Dim oGeomIntent1 As GeometryIntent Dim oGeomIntent2 As GeometryIntent oGeomIntent1 = oSheet.CreateGeometryIntent(finalCurve.StartPoint, kStartPointIntent) oGeomIntent2 = oSheet.CreateGeometryIntent(finalCurve.EndPoint, kEndPointIntent) Dim textPoint As Inventor.Point2d = ThisServer.TransientGeometry.CreatePoint2d(oView.Center.X,oView.Top)
'Error on this line below Dim oDim As GeneralDimension = oSheet.DrawingDimensions.GeneralDimensions.AddLinear(textPoint, oGeomIntent1, oGeomIntent2, DimensionTypeEnum.kHorizontalDimensionType)
Solved! Go to Solution.