Dimension exception

Hello All,


When I try to add dimension to a Drawing View I get the exceltion "Exception from HRESULT: 0x80040B30". I am not sure what is the cause.


This is the code:


objView = objSheet.DrawingViews.Item(1)

objView.Range(min_x:=XMinView, min_y:=YMinView, max_x:=XMaxView, max_y:=YMaxView)
objView.ViewToSheet(xView:=XMinView, yView:=YMinView, xSheet:=XMinSheet, ySheet:=YMinSheet)
objView.ViewToSheet(xView:=XMaxView, yView:=YMaxView, xSheet:=XMaxSheet, ySheet:=YMaxSheet)

objLines = objView.DVLines2d
objLine1 = objLines.Item(1)
objLine2 = objLines.Item(2)
objLine3 = objLines.Item(3)
objLine4 = objLines.Item(4)
Dim xDim As String = ""
Dim yDim As String = ""

objDimensions = objSheet.Dimensions
objDimension = objDimensions.AddDistanceBetweenObjects(objLine1.Reference, XMinSheet, YMinSheet, 0.0, False, objLine2.Reference, XMaxSheet, YMinSheet, 0.0, False)


Re: Dimension exception

I also experience this, but in Part PMI dimensions.  I suspect the cause is geometrically invalid choices for the dimension.  E.g. getting a distance between two intersecting objects.