Message 1 of 1
Failed in creating the Geometry IntentUnspecified error (Exception from HRESULT: 0x800004005 (E_FAIL)

Not applicable
01-27-2021
01:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a code that can "included" any 3D Sketch in my Drawing, and then generate dimension for all the lines on each view. So far, it works fine with the Inventor Professional 2018 version, but with Inventor 2018 (standard?) it keep giving out this error:
Failed in creating the Geometry IntentUnspecified error (Exception from HRESULT: 0x800004005 (E_FAIL))
Do anyone know what is going on with this?
Try
Dim oAsmComp As AssemblyDocument
oAsmComp = frontview.ReferencedDocumentDescriptor.ReferencedDocument
Dim occ As ComponentOccurrence
occ = oAsmComp.ComponentDefinition.Occurrences.Item(1)
Dim part As PartDocument = Nothing
part = occ.ReferencedDocumentDescriptor.ReferencedDocument
Dim oProx As Sketch3DProxy = Nothing
occ.CreateGeometryProxy(Sketch3D, oProx)
Call frontview.SetIncludeStatus(oProx, True)
For Each line As SketchLine3D In oProx.SketchLines3D
Dim drawingCurves = frontview.DrawingCurves(line)
Dim drawingCurveIntent = oSheet.CreateGeometryIntent(drawingCurves(1))
Dim dimPoint = m_inventorApplication.TransientGeometry.CreatePoint2d(34, 22)
Dim Gendim As LinearGeneralDimension
Gendim = oSheet.DrawingDimensions.GeneralDimensions.AddLinear(dimPoint, drawingCurveIntent)
Gendim.CenterText()
Dim oDimsToBeArranged As ObjectCollection
oDimsToBeArranged = m_inventorApplication.TransientObjects.CreateObjectCollection
oDimsToBeArranged.Add(Gendim)
oSheet.DrawingDimensions.Arrange(oDimsToBeArranged)
Gendim.Style.TextStyle.FontSize = 0.254
Gendim.Style.LinearPrecision = LinearPrecisionEnum.kSixteenthsFractionalLinearPrecision
Gendim.Style.LinearUnits = UnitsTypeEnum.kFootLengthUnits
Gendim.Style.DisplayFormat = DisplayFormatEnum.kFractionalNotStackedFormat
Next
Catch ex As Exception
MsgBox("Failed in creating the Geometry Intent" + ex.Message)
End Try
Another question:
This code, every time it called out an dimension, it must put the point at (34,22) before arrange-ing it, is there a better way to do this? Also, I tried to get the Gendim.Style formats outside of the For loop, but keep failing. Please help me! Thank you.