Inventor Customization

Inventor Customization

Reply
Valued Contributor
petrxn
Posts: 91
Registered: ‎03-22-2007
Message 1 of 4 (268 Views)

change text on note

268 Views, 3 Replies
01-10-2013 04:09 AM

I have found an problem with change text on drawing note trough API.
Situation:
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.

Inventor 2013SP1

 

Thank you

ADN Support Specialist
xiaodong.liang
Posts: 1,335
Registered: ‎06-12-2011
Message 2 of 4 (247 Views)

Re: change text on note

01-17-2013 10:48 PM in reply to: petrxn

Hi,

 

What I saw is slightly difference to yours. (also Inventor 2013 SP1)

 

  1. Create a leader note manually. In default, its color is bylayer
  2. Run your code.

     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?



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Valued Contributor
petrxn
Posts: 91
Registered: ‎03-22-2007
Message 3 of 4 (239 Views)

Re: change text on note

01-18-2013 02:01 AM in reply to: xiaodong.liang

Hi,

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).

 

Thank you

Petr

ADN Support Specialist
xiaodong.liang
Posts: 1,335
Registered: ‎06-12-2011
Message 4 of 4 (223 Views)

Re: change text on note

01-22-2013 05:00 PM in reply to: petrxn

I will log this issue. 



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.