Converting text to geometry when performing a 2d view export

Converting text to geometry when performing a 2d view export

haroon.haider39ZXL
Contributor Contributor
1,830 Views
5 Replies
Message 1 of 6

Converting text to geometry when performing a 2d view export

haroon.haider39ZXL
Contributor
Contributor

We have been able to get access to the lines, grids, annotations and other basic elements of a 2d view (using the  IExportContext2D interface).  Is there a way to convert the annotation text from strings to geometry using Revit API similar to how you can do it in AutoCAD ? 

 

I'm looking to get something like the attached image.

 

0 Likes
Accepted solutions (1)
1,831 Views
5 Replies
Replies (5)
Message 2 of 6

jeremy_tammik
Alumni
Alumni

You could take recourse to a pixel image, if all else fails...

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 6

haroon.haider39ZXL
Contributor
Contributor
Accepted solution

Update: I ended up getting what I need by processing a TextNode from the export context method OnText() call.  There is enough information in the text node class to be able to convert it to a GraphicsPath and pull out the geometry from there.

0 Likes
Message 4 of 6

jeremy_tammik
Alumni
Alumni

Thank you for confirming! I added your note of your solution to the blog:

 

https://thebuildingcoder.typepad.com/blog/2022/01/detailed-2d-text-and-other-element-geometry.html#3

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 6

olena_havatiuk
Explorer
Explorer
Im really appreciate for your info, many thanks!!
0 Likes
Message 6 of 6

revitapi99
Community Visitor
Community Visitor

Hi @haroon.haider39ZXL 

 

Can you please elaborate how you have converted TextNode to GraphicsPath, I want to export the text geometry and I want to extract text path points.

0 Likes