Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Export DWG: Exporting tags as blocks with attributes

OrmArTHe
Contributor

Export DWG: Exporting tags as blocks with attributes

OrmArTHe
Contributor
Contributor

Is it possible to use Revit API to export tags as blocks with attributes?

I'm aware of of EDER-Tool mentioned here

 

However, I'd like to use Revit API to do those exports.

Since I'm a newcomer to Revit API, could someone point me in the right direction, possibly suggest some Classes in the docs to look into?

 

Thanks!

0 Likes
Reply
387 Views
5 Replies
Replies (5)

ctm_mka
Advocate
Advocate

directly, i would say no, Revit wouldn't know what a attributed block is. So you would need to interact with your CAD programs API. Probably easier to create a conversion program in the CAD program instead? A possible workflow: First, the attributed block would need to exist in some DWG already, so it could be inserted into the exported DWG. Assign a specific layer to the tag categories in the DWG Export element. Since tags are exported as MText (at least for AutoCAD), you would look for Mtext on that specific layer. Next read the contents, then lastly insert the block at the mtext's position, fill out the attribute, delete the text.

OrmArTHe
Contributor
Contributor

Thank you for the suggestions...

 


@ctm_mka wrote:

directly, i would say no, Revit wouldn't know what a attributed block is. So you would need to interact with your CAD programs API. Probably easier to create a conversion program in the CAD program instead? A possible workflow: First, the attributed block would need to exist in some DWG already, so it could be inserted into the exported DWG. Assign a specific layer to the tag categories in the DWG Export element. Since tags are exported as MText (at least for AutoCAD), you would look for Mtext on that specific layer. Next read the contents, then lastly insert the block at the mtext's position, fill out the attribute, delete the text.


I did a little bit of whiteboarding, I believe your workflow suggestion could work but only in a scenario where:

1 Mtext == 1 block with 1 attribute

My scenario is:

n Mtexts == 1 block with n attributes

So, one block has multiple attributes. In that case, each Mtext should somehow be identified with:
1) Revit Tag
2) Revit Tag Parameter

Any ideas?

I'm using AutoCAD btw, so whatever the logic behind the solution, I'll be using AutoCAD API to get there...

0 Likes

ctm_mka
Advocate
Advocate

First, do you you absolutely need n Mtexts == 1 block with n attributes? Its been awhile, but do attributed blocks not support multiline? so potential to do n Mtexts == 1 block with 1 multiline attributes.  Otherwise oof. the least headache inducing but most manual labor way would be to go through several drawings manually, look to see how many combos you actually need, and create the necessary blocks. Otherwise creating the blocks in AutoCAD API is the only way i can think of, in which case good luck to you.

0 Likes

OrmArTHe
Contributor
Contributor

First, do you you absolutely need n Mtexts == 1 block with n attributes?


Yes.

so potential to do n Mtexts == 1 block with 1 multiline attributes.


AFAIK, making an attribute multiline just adds the multiline option for that, single attribute. So I'm no sure how it can help me achieve n Mtexts == 1 block with n attribute.


0 Likes

ctm_mka
Advocate
Advocate

exactly, multiline, single attribute, meaning you would only need one block for all. your code would then be reading and formatting the exported Mtext such that it looks the same when set as the value for the attribute.

0 Likes