Inventor Customization

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

change text on note

244 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,262
Registered: ‎06-12-2011
Message 2 of 4 (223 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: 90
Registered: ‎03-22-2007
Message 3 of 4 (215 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,262
Registered: ‎06-12-2011
Message 4 of 4 (199 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube