iLogic: Having some trouble getting HoleThreadNotes.Add Method to do what I want

iLogic: Having some trouble getting HoleThreadNotes.Add Method to do what I want

grantDHM4Z
Participant Participant
171 Views
1 Reply
Message 1 of 2

iLogic: Having some trouble getting HoleThreadNotes.Add Method to do what I want

grantDHM4Z
Participant
Participant

I want to annotate a threaded hole in a section view of a drawing as shown in the attached video (What I want it to do), except instead of doing it manually like in the video I want to use iLogic to do this.

 

The section of code I have right now almost works, but it attaches the thread annotation to the threaded side of the hole, instead of the top, as shown in the other video. I have to go in and move it manually. The edge on top has an entity name ("LiftingHoleFarEdge"), but when I try specify a drawing curve from it and to use that in the method, it gives an unspecified error.

 

This is the relevant part of my current code: 

Dim SectionFOdrawingCurves = osectionviewFO.DrawingCurves 'Drawing curves in the relevant section view
For Each oHoleEdge As DrawingCurve In SectionFOdrawingCurves
    If oHoleEdge.EdgeType = kThreadEdge Then
Dim oThreadNote As HoleThreadNote = oSheet2.DrawingNotes.HoleThreadNotes.Add(ThisApplication.TransientGeometry.CreatePoint2d(SectionSketchFOBP.X+3, SectionSketchFOBP.Y+FD/2*2.54 +2), oHoleEdge)
        myThreadText = oThreadNote.Text.Text
        Exit For
    End If
Next

I have an attached video (What the code does now) that shows how it attaches to the side instead of the top. Should I be using something different than kThreadEdge?  Is the edge I want to have the leader go to even a threaded edge technically?

0 Likes
Accepted solutions (1)
172 Views
1 Reply
Reply (1)
Message 2 of 2

grantDHM4Z
Participant
Participant
Accepted solution

So I got it working for anyone interested. 

'This puts a thread note on the lifting hole
Dim SectionFOdrawingCurves = osectionviewFO.DrawingCurves'(oFace1)
Dim oCurve3 As DrawingCurve = osectionviewFO.DrawingCurves.Item(24)
For Each oHoleEdge As DrawingCurve In SectionFOdrawingCurves
	If oHoleEdge Is oCurve3 Then
		Dim oThreadNote As HoleThreadNote = oSheet2.DrawingNotes.HoleThreadNotes.Add(ThisApplication.TransientGeometry.CreatePoint2d(SectionSketchFOBP.X-.125, SectionSketchFOBP.Y+FD/2*2.54 +2), oHoleEdge)
        myThreadText = oThreadNote.Text.Text
        Exit For
    End If
Next
0 Likes