- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I would like to create dimension between two points, but I get an error that I can't fix.
This is a snippet of larger code, hopefully it is readable
Public Sub PlaceDimension(oDoc As Document, oSheet As Sheet, oAssem As AssemblyDocument,
ViewName As DrawingView, PositionX As Double, PositionY As Double,
AttrSetName1 As String, AttrName1 As String, AttrValue1 As String,
AttrSetName2 As String, AttrName2 As String, AttrValue2 As String) 'RULE TO ADD ONE DIMENSION
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
Dim oGeneralDims As GeneralDimensions
oGeneralDims = oSheet.DrawingDimensions.GeneralDimensions
Dim aoEdge4 As Edge
Dim aoEdge3 As Edge
oObjs1 = oAssem.AttributeManager.FindObjects(AttrSetName1, AttrName1, AttrValue1)
oObjs2 = oAssem.AttributeManager.FindObjects(AttrSetName2, AttrName2, AttrValue2)
aoEdge4 = oObjs1.Item(1)
aoEdge3 = oObjs2.Item(1)
oDrawingViewCurves1 = ViewName.DrawingCurves(aoEdge4)
oDrawingViewCurves2 = ViewName.DrawingCurves(aoEdge3)
Dim aoDrawingCurve4 As DrawingCurve
Dim aoDrawingCurve3 As DrawingCurve
aoDrawingCurve4 = oDrawingViewCurves1.Item(1)
aoDrawingCurve3 = oDrawingViewCurves2.Item(1)
Dim oPt2 As Point2d
oPt2 = oTG.CreatePoint2d(PositionX, PositionY)
Dim GeoIntent1 As GeometryIntent
Dim GeoIntent2 As GeometryIntent
GeoIntent1 = oSheet.CreateGeometryIntent(aoDrawingCurve3.MidPoint)
GeoIntent2 = oSheet.CreateGeometryIntent(aoDrawingCurve4.MidPoint)
oDim2 = oGeneralDims.AddLinear(oPt2, GeoIntent1, GeoIntent2)
oDim2.CenterText
End Sub
Solved! Go to Solution.