Hole Thread note arrowhead attachment location

Hole Thread note arrowhead attachment location

Raider_71
Collaborator Collaborator
609 Views
6 Replies
Message 1 of 7

Hole Thread note arrowhead attachment location

Raider_71
Collaborator
Collaborator

Hi I am experiencing an issue where the Hole notes I am inserting programatically, have undesirable behaviour.

I am using the standard method:

Snippet

Dim oThreadNote As HoleThreadNote
oThreadNote = oDoc.ActiveSheet.DrawingNotes.HoleThreadNotes.Add(oPosition, oDrawingCurve)

 

Basically what happen is if the note is inserted with a location point below the hole location then it looks fine. See image:

 

Correct.jpg

 

 

If inserted with a location above the holes then it looks like this:

 

Wrong.jpg

 

As you can see its not an ideal solution. Is there a way to control this?

 

Thanks!

 

Pieter

 

0 Likes
610 Views
6 Replies
Replies (6)
Message 2 of 7

adam.nagy
Autodesk Support
Autodesk Support

Hi Pieter,

 

I could reproduce the issue and have logged it in our system #110312.
I'm wondering if there might be an underlying product issue here as well, since the same result can be achieved through the UI on purpose: https://www.youtube.com/watch?v=Ni5Q2_SvqkE

 

Based on the above experience I came up with this code which I assume is not robust at all, but who knows. If I took the note text through the center of the hole then it was working ok for my drawing: https://www.youtube.com/watch?v=L6_5qGyMEnw 

Sub AddHoleThreadNote()
  Dim oDoc As DrawingDocument
  Set oDoc = ThisApplication.ActiveDocument

  Dim oDrawingCurveSegment As DrawingCurveSegment
  Set oDrawingCurveSegment = oDoc.SelectSet(1)

  Dim oDrawingCurve As DrawingCurve
  Set oDrawingCurve = oDrawingCurveSegment.Parent

  Dim oTG As TransientGeometry
  Set oTG = ThisApplication.TransientGeometry

  Dim oPosition As Point2d
  Set oPosition = oTG.CreatePoint2d(0, 0)
  
  Dim oDrawingNotes As DrawingNotes
  Set oDrawingNotes = oDoc.ActiveSheet.DrawingNotes
 
  Dim oThreadNote As HoleThreadNote
  Set oThreadNote = oDrawingNotes.HoleThreadNotes.Add( _
    oPosition, oDrawingCurve)
    
  ' Without this line of code the arrow line
  ' will cut accross the hole
  'oThreadNote.text.Origin = oDrawingCurve.CenterPoint
    
  Dim oPositionNew As Point2d
  Set oPositionNew = oTG.CreatePoint2d(10, 50)

  oThreadNote.text.Origin = oPositionNew
End Sub

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 7

sundaram1087
Advocate
Advocate

Hi Adam

 

 

I created the holethread note using vb.net programming. now i want to change the text of the holethread note (Ex- 1/4-18 NPT to 1/4-18 (3 Places))

 

Could be please provide some sample for this

 

Regards,

K.Shunmugasundaram

 

 

0 Likes
Message 4 of 7

adam.nagy
Autodesk Support
Autodesk Support

It should automatically update to whetever the current thread is.

 

Are you trying to override what is shown? In the UI as well you only seem to be able to add additional text to the name of the Thread Type, but cannot modify it.



Adam Nagy
Autodesk Platform Services
0 Likes
Message 5 of 7

sundaram1087
Advocate
Advocate

Hi Adam

 

               may i get the procedure to add the addtional text to the existing one.

               Shall you share some code samples for that

 

 

Regards,

K.Shunmugasundaram

 

 

 

0 Likes
Message 6 of 7

adam.nagy
Autodesk Support
Autodesk Support

Best thing is to investigate the objects in VBA:
http://adndevblog.typepad.com/manufacturing/2013/10/discover-object-model.html

 

Here is my code:

Sub ChangeThreadNoteText()
  ' First select hole thread note in the UI
  ' then run this
  Dim n As HoleThreadNote
  Set n = ThisApplication.ActiveDocument.SelectSet(1)
  
  n.Text.FormattedText = "additional text"
End Sub

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 7 of 7

sundaram1087
Advocate
Advocate

Hi Adam

 

Thanks for sharing the sample code for that options

 

Regards,

K.Shunmugasundaram

 

0 Likes