I have found an problem with change text on drawing note trough API.
Create leader note in empty drawing
Change text on this note with following code:
Public Sub Run() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oNotes As DrawingNotes Set oNotes = oDoc.ActiveSheet.DrawingNotes oNotes(1).FormattedText = "abcd" Debug.Print oNotes(1).Color.ColorSourceType End Sub
Then edit text stnadrda dialog, result is that color of text is changed from bylayer to overwited color.
Strange is that trough api is color still set as bylayer.
I am not able to find how to coerrect it.
What I saw is slightly difference to yours. (also Inventor 2013 SP1)
2.1) The code returns the color type is kLayerColorSource . This is correct because the code modifies the text content only
2.2) The drawing shows the text is changed. And looks color is not changed.
2.3) when you open the text edit dialog of leader note manually right now, you can find the color has been changed to green!
3. Now, if you change to other color manually, and run your code again, the color type returns kOverrideColorSource >> correct.
4. If you modify the color manually right after you creating the leader note, the color type will also return kOverrideColorSource >> correct
So, the only problem to me is 2.3.
Could you double check at your side?
yes, this is exactly the problem. I didnot find any pssibility to change the note text correctly yet. There is next problem that these text are wrongly exported to autocad , these text are exported in white color (expected is black acc.to layer).
Access a broad range of knowledge to help get the most out of your products and services.