Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to mark and dimension multiple holes on a drawing view. When I run my rule it only marks and dimensions that last item in the rule. If I comment out the last line it then marks and dimensions the new "last" line. It remove and existing center marks and diameter dimensions. I have included a snippet of what I am trying to achieve and the code I have created so far. If you could please review and explain to me what I am doing incorrect as I am a newer user of iLogic.
Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oDimStyle As Style = oDoc.StylesManager.DimensionStyles.Item("Dual")
Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
'FrontView
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("VIEW1")
Dim namedGeometry1 = VIEW1.GetIntent("OD")
Dim namedGeometry2 = VIEW1.GetIntent("TopPoint2")
Dim namedGeometry3 = VIEW1.GetIntent("Bottom")
Dim namedGeometry4 = VIEW1.GetIntent("LeftPoint")
Dim namedGeometry5 = VIEW1.GetIntent("RightPoint")
Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions
'Side Height
Dim linDim1 = genDims.AddLinear("Dimension 1", VIEW1.SheetPoint(-0.07, -0.1), namedGeometry1)
'Overall Height
Dim linDim2 = genDims.AddLinear("Dimension 2", VIEW1.SheetPoint(1.1, 0), namedGeometry2, namedGeometry3)
'Inside Diameter
Dim linDim3 = genDims.AddLinear("Dimension 4", VIEW1.SheetPoint(0.25, -0.3), namedGeometry4, namedGeometry5)
'TopView
Dim VIEW2 = Sheet_1.DrawingViews.ItemByName("VIEW2")
'Add Centermark to View
Dim holeIntent = VIEW2.GetIntent("OD", PointIntentEnum.kCenterPointIntent)
Dim centermark = Sheet_1.Centermarks.Add("Hole Centermark", holeIntent)
'Add Centermark and Dimension to Left Hole
Dim hole2 = VIEW2.GetIntent("Hole2")
Dim holeDim = genDims.AddDiameter("Hole Diameter", VIEW2.SheetPoint(0, .25), hole2)
Dim centermark2 = Sheet_1.Centermarks.Add("Hole Centermark", hole2)
'Add Centermark and Dimension to Right Hole
Dim hole3 = VIEW2.GetIntent("Hole3")
Dim holeDim1 = genDims.AddDiameter("Hole Diameter", VIEW2.SheetPoint(1, .25), hole3)
Dim centermark3 = Sheet_1.Centermarks.Add("Hole Centermark", hole3)
Dim oUnitOfMeas As UnitsOfMeasure = ThisApplication.ActiveDocument.UnitsOfMeasure
linDim1.NativeEntity.Tolerance.SetToReference
linDim3.NativeEntity.Precision = 3
linDim3.NativeEntity.Text.FormattedText = ("Ø<DimensionValue/>")
Solved! Go to Solution.