I am starting with Dynamo and don’t know a lot. I spent 3 days trying to figure this out before I gave up and decided to ask for help here.
I would like to write property value of labels that are visible on plan view. I would like these values to be assigned based on the family name. The idea behind it is to have ‘‘gauge’’ field for frames on the floor (not entire building) populated according to the gauge of the members used for frames. I’d like to add that there are frames of various gauges on one floor. Below screen grab of where I got so far after multiple attempts(sorry but I can upload only one file as a new user). Any insight would be appreciated and remember that I am a total noob in Dynamo.
1.Most successful so far
2.Plan view with frame labels
3.Frame members
Thanks for expressing interest in this post.
Let me explain it a little bit better (hopefully).
I am working with structural framings via MWF in Revit 2018-2020 (whatever client uses).
on the plan below you can see a plan view with frame elements and frame label F-39.
frame members and frame label are separate elements and connected only by parameter ‘‘BIMSF_Container’’ (also photo below).
This gauge is derived from the structural framing element thickness which is described by the code ‘‘F10020’’ in family type name where ‘‘20’’ at the end of the code means 2.0 thickness.
On the floor we may encounter frames made of various gauges between 1.2 - 3.0 but one frame is always made of one gauge. I hope you can see now how having 130 frames which you need to populate manually may become a tedious task after couple of years. I was hoping to somehow use Family type name of frame elements to populate ‘‘Gauge’’ field in label element.
So far I made nodes to extract some data that may/may not be useful (photo below)
And I started experimenting with picking frame labels from plan (we want to limit them to one floor and not entire building). Then I got stuck and wasn’t sure how or where to proceed so I changed approach and thought maybe trying to make solution for only one label which then may be scripted to re-run all remaining frames on the floor hence nodes for one and for all labels on the photo below.
Lastly to answer m.owen’s question, I work in Revit for couple of years now but its mostly limited to 2D frame drawings via MWF plugin. (obv I sometimes inspect frames in 3D to get the information for detailing where necessary).
The frame label is a group of elements representing… something… (a connection I think) including multiple framing members of varying gauge. The only thing connecting the group and the individual members is the frame label, BIMSF_Container. You want to write all the gauges of a given group back to its respective label.
In order to do that you’ll have to get the BIMSF_Container value for the labels and the members. You can then sort and group them by value. As long as you have exactly the same values in both lists (no extra or missing values) that’s all you’ll have to do for collecting the elements. With the members and groups now in sublists according to label, you can simply get the gauge values from the members and write them directly to the respective label.
Yes labels and structural members are separate elements linked only by BIMSF_Container. I am going to do it from scratch later to try and replicate what you said. However, if you have any particular nodes on your mind feel free to share Thanks to all for your input!
So I didn’t have a lot of time to research dynamo in last couple of weeks but yesterday I finally sat down and made a little step forward (hopefully). I managed to isolate all frame members (group 1), gather all frame tags(group 2) and check if all frame members in group 1 contain BIMSF information (which they do and can be seen in right top corner). Now, I believe next step would be to create a list where all frame members (the ones with F100xx codes) are listed under their respective labels. So it would look something like the red text I scribbled over the image below. From there, if I am correct, This list could be possibly used to override Metek_Gauge parameted for Frame Labels in group 2 and that would mark the end of my struggle
Thank you Nick, seems like we are more or less on the same page and with pretty good timing too.
This is where I am right now. I spent over six hours today trying to get this to work and I think it kind of works? I would appreciate your feedback and perhaps some pointers on where to go from here to use ‘‘F100xx’’ values from sorted list to override ‘‘Metek_Gauge’’ values at their respective ‘‘F-xx’’ labels (elements). Also I don’t quite get yet how levels work so this is the only outcome that worked for me based on trial and error. Again, I appreciate all of your feedback and I leave two images below to visually aid.
Your list structure is off (which is probably why you tried to use list levels). Make sure the list of objects and list of keys have the same structure. You also need to sort both groups to make sure everything is in the same order - that’s the whole point here. Once everything is in the same order you can just get the gauge values and write back to the tag.
I think I have done everything you asked for and I have some issues with tag value block (I assumed it’s a code block so I copied the code as seen on the image from @Nick_Boyts. Warning message on the tag value blocks reads:
Warning: Multiple definitions for ‘String’ are found as DSCore.String, WombatDynamo.String
Multiple definitions for ‘String’ are found as DSCore.String, WombatDynamo.String
Multiple definitions for ‘String’ are found as DSCore.String, WombatDynamo.String
Internal error, please report: Dereferencing a non-pointer.
That’s just what I used to represent tag values in my example. You need to get the actual BIMSF_Container values.
Also, don’t use List.Create between your lists. You’re just adding unnecessary levels to your list structure that are going to complicate things. In fact, you probably want to flatten your list so that everything is on the same level.
I hope this is more like what you proposed. @Nick_Boyts I appreciate your last comment. It helped to better understand what levels are and where they come from. Please be patient with me as I am CAD Designer rather than coder and my knowledge in this area ends on basic G-Code programming.
You’re getting close. Look at what I posted again. The TAG VALUE code block is where you would get the tag value from that respective element or tag. You need to sort by each group separately because that’s what determines the order. Be sure you’re sorting the elements too, not just the values. If you sort one based on the other you’re just mixing them up again.
Maintaining list orders in Dynamo is very important.
If you have a list of items, and you “GetParameterByName” then the list of the parameter values matches the list of your items. There is no need to sort the list of parameter values.
Just plug this list of items into the list, and the list of parameter values (F-123, etc.) into the keys.
The bottom “List.SortByKey” can be deleted and the values from the flattened list can go directly into the “List.SortByKey” at the top of the image.
Another downtime in my office so let’s get back to it. I think I did what you asked for and two resulting lists seem to be sorted properly, I also got a minor nose bleed trying to figure out what Nick wanted me to achieve XD
I poked around, tried few things and i managed to get this list to look like what I want to achieve. Now i have clearly listed frame tag (F-XX) with it’s respective gauge. I also kept only first entry as I believe it is going to be required later on(probably wrong here again). Now I am struggling to write these gauges to frame tag’s ‘‘Metek_Gauge’’ parameter.
try using: its a OOTB node, i didnt follow the whole blog, but i think you need to “transpose” the list you have circled with red, then use the first list you get as the input for the set parameter by name node.
You don’t need to create a list…you already have a list. I generally only use this node to combine two list values.
Using the “GetParameterByInstanceOrType” will create an extra layer in your list. That’s why you have a “0 List” under each list. From my point of view, this is not desirable.
I would recommend flattening. You will probably have to use the “@ Level” and play around with the amount.
Once you’ve done this, you can transpose the data if needed. Otherwise, you will likely run into issues.