Revit 2012 API Find and Replace

Revit 2012 API Find and Replace

Anonymous
Not applicable
1,339 Views
4 Replies
Message 1 of 5

Revit 2012 API Find and Replace

Anonymous
Not applicable

I am trying to do a find and replace thru the API. Can anyone point me in the right direction. My biggest issue is keeping the formatting. Part of the text notes are underlined and others are not. I can do a find and replace but cannot seem to keep the formatting. Thanks for your help.

0 Likes
1,340 Views
4 Replies
Replies (4)
Message 2 of 5

Joe.Ye
Alumni
Alumni
Via API, the format of the TextNote string cannot be retrieved. So I don't think you can format the TextNote instance via API at the moment.

 



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 3 of 5

yexiongjin
Contributor
Contributor

That can be an API wish.

0 Likes
Message 4 of 5

Anonymous
Not applicable

What makes me think it is possible is the fact that there is a find and replace within Revit that works the way I want it to. I have a feeling I am going to have to pass it into some kind of form with a richtext box first though.

0 Likes
Message 5 of 5

Joe.Ye
Alumni
Alumni

 

We can manually copy the text with format from the TextNote object after double click it, and paste it in Winword, then strin format can be duplicate.

 

However TextNote.Text just return a plain text, without the format information in the returned string. So we cannot replace the string with format. 

 

There is a change request for get/set the string fromat via API.

 

 



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes