Data attribution using information from a CAD file

Hi all, currently need to populate a parameter using data from a text layer in a DWG file. So far I have linked the cad in for a floor plan and generated the generic models using a dynamo script to create floor separation lines from a cad layer, then kiwi tools to generate a generic model for each room. Just wonder if anyone can think of a way to automatically populate a custom parameter with data from a CAD file.


I had a go with the Bimorph nodes package and got this far:

1 Like

Can you share a sample cad file which contains the type of objects you’re working with?

I think a dataextraction command in autocad may allow you to get the data you need, but I’m not sure how your file is set up.

1 Like

Unfortunately text elements within a DWG or DGN are not exposed in the Revit API (and therefore Dynamo), which means there is no way to access them. The only option is to explode them using the standard Revit Explode command, then you can filter these elements using Dynamo. I believe there is a way to do this using the RevitAPIUI, which simply automates the explode command (see link), however its limited to Revits 10000 element limit.

@jacob.small suggestion is worth pursuing if you are an AutoCAD user.

I’m going to be looking at adding text conversion functionality to BimorphNodes when I find the time as there is another method I am aware of that utilises DXF

4 Likes

@Thomas_Mahon
Thomas,

This might be of use. Love to see this in a package.

Marcel
+++++

1 Like

RoomDataDWG in GenericModelsRevit_working170706.dyn (31.2 KB)
Hi Everyone, thanks for the help so far, just an update. I have imported the dwg containing the room names on top of generic models then exploded the dwg and grabbed the text notes. I’ve managed to create a list that determines whether a point generated from with in the text box intersects with the generic model geometry. L2 of the list refers to each generic model, L1 of the list refers to the particular text item. The trick now is just some list wizadry so that I can use a change element by parameter node to append the specific text with the parameter that I’ve set up in the generic model, each list in L1 should have one boolean true relating to the specific text note . Thanks for all your help so far

Sorry update again, managed to figure out the list myself using an Indexof node with the element set as true;

@julian.venczel

hey julian, would you be so kind and upload your final *.dyn file?
I do need the same solution to add my “rooms” some additional information :slight_smile:

Hi, could you not finalize your workflow with what has been shared already? If so, it would be good practice to simply send a screenshot of your graph showing where it does not work for you: indeed, it would be useful to the community to see how to solve a new issue here, if any.

1 Like

RoomDataDWG in GenericModelsRevit.dyn (24.7 KB)
That was the final file, it works quite effectively for Generic models, I guess it wouldn’t be too much of a stretch to alter it to work on other kinds of solid geometry and it’s also pretty straight forward to get it to populate other parameters as well.

1 Like

Hey, I am looking to get a similar task completed.

I have lights in a DWG with a reference in text next to them. Then I have a revit file with plans that look exactly the same with the smae Arch back ground and lights in the same positions.
(Obviously the lights in REVIT are family’s and in CAD they are blocks)

I want to get the reference from CAD into the family parameter. Each light fitting has its own number, and there is around 8000 of them.

Do you think this DYN you have here could help me towards getting this done, or could someone tell me if this is even possible.

Anyone’s help is very much appreciated in advance.

1 Like

As it’s similar but not the same I suggest creating a new topic and simply putting a link here asking for help.

Hi @lewiskent,

The workflow I used involved isolating the layers with the desired text from the CAD files, (We used a LISP routine to clean out over 200 floor plans but obviously you can just delete the unnecessary layers manually). The DWGs were then brought into revit and exploded to give us text notes, as I mentioned before. As long as the text notes are placed directly underneath the desired family you could text for collision, the trick is filtering out the notes that don’t collide with anything (removing nulls). From there it’s just a matter of replacing the desired parameter with the data from the text notes. Let me know if you need any further direction.

Regards, Julian

1 Like

Hi, your dynamon is not working, can you help?

Maybe, to be honest the data attribution didn’t work for 100% of the generic models but it worked for enough that it saved a lot of time anyway. What isn’t working for you?

FYI… Importing text from CAD to REVIT you can also pull the insertion point info…

1 Like