Ilogic Chain Dimensions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a part the contains up to four rows of holes depending on the overall height of the part (e.g 1,2,3 or 4 rows) and I trying to use iLogic to automatically create vertical chain dimension depending on that height. I've found a snippet of code for this (see below), but it's only in vba and I don't know how to convert it. Thanks.
Public Function DimToWorkPoints(ByVal DrawView As DrawingView, _ ByVal WorkPoint1 As WorkPoint, _ ByVal WorkPoint2 As WorkPoint, _ ByVal TextPosition As Point2d, _ ByVal AlignmentType As DimensionAlignmentTypeEnum) As GeneralDimension
Try
Dim sheet As Sheet sheet = DrawView.Parent
' Create centermarks based on the work points. Dim marks(1) As Centermark marks(0) = sheet.Centermarks.AddByWorkFeature(WorkPoint1, DrawView) marks(0).Visible = False marks(1) = sheet.Centermarks.AddByWorkFeature(WorkPoint2, DrawView) marks(1).Visible = False
' Create geometry intents for the center marks. Dim intent1 As GeometryIntent intent1 = sheet.CreateGeometryIntent(marks(0)) Dim intent2 As GeometryIntent intent2 = sheet.CreateGeometryIntent(marks(1))
' Add a dimension. Dim genDim As GeneralDimension genDim = sheet.DrawingDimensions.GeneralDimensions.AddLinear(TextPosition, _ intent1, intent2, AlignmentType) Return gen
Dim Catch ex As Exception
Return Nothing
End Try
End Function