What's the HoleThreadNote text format?

What's the HoleThreadNote text format?

bwang-tecoustics
Collaborator Collaborator
773 Views
6 Replies
Message 1 of 7

What's the HoleThreadNote text format?

bwang-tecoustics
Collaborator
Collaborator

I want to replace the word in a HoleThreadNote but not succeed. Per the screenshot below, I can't figure out what is the HoleThreadNote text format. It's different than other drawing notes, and even different than dimensions. Any ideas?

Image shows the value I got from FormattedText property and Text property of the HoleThreadNote.

HoleThreadNote.png

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

bwang-tecoustics
Collaborator
Collaborator

This is crazy.

I finally find that the text of the HoleThreadNote is called FormattedHoleThreadNote and I'm able to replace the word in it. But, after the word is replaced, the Hole callout shows this plus/minus 0 symbol. I don't know where it was from and I can't find it in the note editor. It's simply showup.

HoleThreadNote2.pngHoleThreadNote3.pngHoleThreadNote4.png

0 Likes
Message 3 of 7

bwang-tecoustics
Collaborator
Collaborator

The code I used is:

mHTNote.FormattedHoleThreadNote = mHTNote.FormattedHoleThreadNote.Replace("red fox", "blue box")

And it makes location 1 to be turned off, and 2 to be turned on. I don't know what caused this to be triggered with a text replace. See below.

 

HoleThreadNote5.png

0 Likes
Message 4 of 7

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

I can reproduce this issue, but did not find how to reset it. I will log a ticket in the internal tracking system with our engineer team.

 

This is the dataset I tested with.

 

  1. open the attached drawing
  2. run the VBA code below

the 'red' is replaced with 'blue', but the tolerance sign is toggled on. 

 

Sub test()
 Dim oDoc As DrawingDocument 
Set oDoc = ThisApplication.ActiveDocument 
Dim oHoleNote As HoleThreadNote 
For Each oHoleNote In oDoc.ActiveSheet.DrawingNotes.HoleThreadNotes 
Debug.Print oHoleNote.Text.Text 
Dim oldFormattedText As String 
oldFormattedText = oHoleNote.FormattedHoleThreadNote 
Debug.Print oldFormattedText 
Dim newFormattedText As String 
newFormattedText = Replace(oldFormattedText, "red", "blue") 
Debug.Print newFormattedText oHoleNote.FormattedHoleThreadNote = newFormattedText 
Next 
End Sub
Message 5 of 7

xiaodong_liang
Autodesk Support
Autodesk Support

As said, I logged the issue: INVGEN-9413

 

Message 6 of 7

bshbsh
Collaborator
Collaborator

@xiaodong_liang wrote:

As said, I logged the issue: INVGEN-9413

 


Thanks. I have the same problem. post1, post2

Hope it gets solved now.

Message 7 of 7

clutsa
Collaborator
Collaborator

In INVGEN-9413 is there a way to turn the tolerance toggle off with API? I see it's been a little over a year and was just wondering if this was resolved?

If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State

Custom Glyph Icon for iMates