Placing a dimension in a groove on a revolved profile using iLogic

Placing a dimension in a groove on a revolved profile using iLogic

harvey_craig2RCUH
Advocate Advocate
275 Views
2 Replies
Message 1 of 3

Placing a dimension in a groove on a revolved profile using iLogic

harvey_craig2RCUH
Advocate
Advocate

I would like to dimension the bottom of a groove in iLogic. Here is it using the UI:

harvey_craig2RCUH_0-1723802662697.png

I have named the angled face in the part and I want my intents to point to most inner part. I have tried the nearPoint method and the PointIntentEnum method to no avail.

Here is my code, I have also attached the files:

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView = oSheet.DrawingViews.Item(1)
Dim viewname As String = oView.Name 'get view name
Dim MainSheet = ThisDrawing.ActiveSheet'Sheets.ItemByName("HYD-A4:1")
Dim VIEW1 = MainSheet.DrawingViews.ItemByName(viewname)

'Dim FirstGrooveFace1 = VIEW1.GetIntent("FirstGrooveFace", nearPoint := VIEW1.SheetPoint(1, 0))
'Dim FirstGrooveFace2 = VIEW1.GetIntent("FirstGrooveFace", nearPoint := VIEW1.SheetPoint(1, 1))
Dim FirstGrooveFace1 = VIEW1.GetIntent("FirstGrooveFace", PointIntentEnum.kTopLeftPointIntent)
Dim FirstGrooveFace2 = VIEW1.GetIntent("FirstGrooveFace", PointIntentEnum.kBottomLeftPointIntent)

Dim genDims = MainSheet.DrawingDimensions.GeneralDimensions
ThisDrawing.BeginManage()
If True Then
	Dim FirstGrooveFaceDia = genDims.AddLinear("FirstGrooveFaceDia", VIEW1.SheetPoint(0.7, 0.5), FirstGrooveFace1, FirstGrooveFace2, , , False) : FirstGrooveFaceDia.NativeEntity.Text.FormattedText = "<DimensionValue/><br/>(BOTTOM OF GROOVE)"
End If
ThisDrawing.EndManage()

I suspect my error is to do with my intents not being explicit:

harvey_craig2RCUH_1-1723802929939.png

 

Many thanks,

Harvey

0 Likes
Accepted solutions (1)
276 Views
2 Replies
Replies (2)
Message 2 of 3

daltonNYAW9
Advocate
Advocate

This isn't working b/c the inside line isn't visible in the drawing so, I'm guessing it cant create a box for the "kTopPointIntent", bottom, etc.

I made this rule that loops through all drawing curves in the view and finds the lines that match the model geometry of the face. Works for this model, might give you trouble with other ones.

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView = oSheet.DrawingViews.Item(1)
Dim viewname As String = oView.Name 'get view name
Dim MainSheet = ThisDrawing.ActiveSheet'Sheets.ItemByName("HYD-A4:1")
Dim VIEW1 = MainSheet.DrawingViews.ItemByName(viewname)

'Dim FirstGrooveFace1 = VIEW1.GetIntent("FirstGrooveFace", nearPoint := VIEW1.SheetPoint(1, 0))
'Dim FirstGrooveFace2 = VIEW1.GetIntent("FirstGrooveFace", nearPoint := VIEW1.SheetPoint(1, 1))
Dim FirstGrooveFace1 = VIEW1.GetIntent("FirstGrooveFace1")
'Dim FirstGrooveFace2 = VIEW1.GetIntent("FirstGrooveFace", PointIntentEnum.kCircularBottomPointIntent)
Dim oFace As Face = FirstGrooveFace1.Geometry.ModelGeometry
'myparam = InputBox("Prompt", "Title", oDrawingCurve.ModelGeometry.type.tostring)

Dim points As List(Of GeometryIntent) = New List(Of GeometryIntent)()

For Each oDrawingCurve As DrawingCurve In oView.DrawingCurves
	If oDrawingCurve.ModelGeometry Is oFace
		Dim intent1 As GeometryIntent = oSheet.CreateGeometryIntent(oDrawingCurve, PointIntentEnum.kStartPointIntent)
		Dim intent2 As GeometryIntent = oSheet.CreateGeometryIntent(oDrawingCurve, PointIntentEnum.kEndPointIntent)
		points.Add(intent1)
		points.Add(intent2)
	End If
Next

Dim orderedIntents as List(Of GeometryIntent) = points.OrderBy(Function(s) s.PointOnSheet.X).ToList

'Dim genDims = MainSheet.DrawingDimensions.GeneralDimensions
Dim genDims As GeneralDimensions = oSheet.DrawingDimensions.GeneralDimensions
Dim oPoint As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(0, 9)
oPoint.X = orderedIntents.Item(0).PointOnSheet.X - 0.5


ThisDrawing.BeginManage()
If True Then
	Dim FirstGrooveFaceDia As LinearGeneralDimension = genDims.AddLinear(oPoint, orderedIntents.Item(0), orderedIntents.Item(1))
	FirstGrooveFaceDia.ArrowheadsInside = False
	FirstGrooveFaceDia.Text.FormattedText = "<DimensionValue/><br/>(BOTTOM OF GROOVE)"
End If
ThisDrawing.EndManage()



Message 3 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

@harvey_craig2RCUH , I would probably recommend just using some helper work points in this particular case, due to some of the reasons daltonNYAW9 alluded to.

Here you can use an origin plane and the edge to create the points, and then use those points as your intent by supplying lines such as this. Note I don't think Capture Current State will pick these up, but you can type them in as shown:

 

Dim WkPt1 = VIEW1.GetIntent("Work Point1")

 

Curtis_Waguespack_0-1723825195565.png

 

EESignature