Change color of elements depending on distance from crane

How would you define it… would you be able to show anything within 5m of the tower of the crane (the crane cant lift) so would show up a Red, then anything weighing over 15.6t between 5 and 40m, anything over 14.6t between 40m and 45m, 45.1 to 50m anything over 13t…

 

If that is posible that would be pretty impresive.

 

Tom

It should be possible, provided every element has a Weight parameter.

Then assuming these distance increments are fixed you could have 4 colors (red, blue, green, yellow) based on the distance ranges specified.

In addition, anything that exceeds the weight limit can be high lighted (maybe red again).

Will work on it sometime, not sure when. Until then I hope the definitions above help serve your immediate task.

 

Thank you for your help this is know work well, the team think it is great !!

 

Cheers Tom

1 Like

Picking this thread up again.

 

So the above definition is working really well, but now we are looking to have the various crane lifting Radius defined individually instead of increments.

Is this possible? If so, how would i go about it? Our tower crane has 3 different lifting Radius we need to define elements within each radius.

Radius are:

  • 50meter (max R of crane)
  • 41.9meter
  • 4.6meter (min R of crane)
Any help would be appreciated

CraneRadius is the definition i am using

Cheers

1 Like

Substitute the following line in the code block…

d2=List.MinimumItem(d1)…List.MaximumItem(d1)…~inc;

with this…

d2={4600,41900,50000};

Haven’t tested, but should mostly work.

I am using the CraneRadius_ABro_Rev02 code with a few changes to make it go from one point and not increment. However I can’t get the weight parameter to work in the code it isn’t recognizing it in the get parameter by name block. Any suggestions?

Drew. in the definition you attached, it looks for the parameter named “Weight (t)” This is a Project parameter we added into the project file before running the code. You can change it to look at any parameter you are using for the weight of your objects. You’ll just need to change the “Weight Parameter Name” code blocks to your own parameter name.

Hope this helps

Hi Drew,

What is the error message it is showing? Possible for any screenshot?

Alisder, would I do that in Revit? I have the “W” parameter that I tried but it still won’t fill the element.getparametervalue array. Any suggestions?

Kulkul,

I don’t get an error until the end when it says that the filter can not be completed. This is because the W

filter error

Can you post up your edited definition (you mentioned you had made changes) please?

The definition we had is not really universal, it was set up to run a particular task so may need some specific changes depending what you are trying to do.

What have you changed and what are you expecting it to do when you run it?

The changes I made were in the code I attached earlier, CraneRadius_ABro_Rev02, I added the “Weight (t)” to the schedule in Revit by creating a formula using Length/1ft * W. But the get parameter value by name node doesn’t recognize the Weight (t) and the element show up in the array but no weight with them. I can bring the Length in successfully but not the W or Weight (t).

Okay, so first of all, you need to add the “Weight (t)” parameter as a project parameter. You are adding it as a calculated value in a schedule, Dynamo wont pick that up as a parameter.

Secondly, you have made changes to the radius values and the sorting into group code line as well. I use millimeters in my project, the lists could be empty because nothing falls into the radius you specified. Also, im unsure why you changed the grouping code line?

Try creating the Weight parameter as a project parameter (Manage Tab > Project Parameter > Add) then run the code. Have you ensured you have changed all the values that the definition was initially analyzing? (Parameter names, total lifting weights, list index numbers and colours)

Do the above and try re running it. Remember you will most likely have to close the dynamo file and re open it to re run it (annoying Dynamo ‘problem’)

keep us posted

This might be me not knowing enough about Revit but, I can’t seem to set a formula for the Project Parameter that I created Weight (t). I have it showing up in the properties window for each element but it is empty. Any suggestions?

Drew

No you are correct, you cant add in that kind of formula to a project parameter. My apologies, i used project parameters as we had a stupid amount of objects, so adding in the parameters to each family would have been a nightmare.

If you have a weight parameter in your families already, just set the dynamo definition to read that (whatever you named it) or, if you need to use a formula to get the weight, you could add another few nodes in the definition to get parameter X, multiply by parameter Y and push that value into the newly created project parameter, then run the rest of the code.

I will send you my updated version of the definition and add in the extra stuff for you with an explanation so you can understand the process over the weekend if you like?

 

If you could send that it would be excellent! I am making some progress on my end but seeing what you came up with could be very helpful!

I am one step closer. I started using the volume to calculate the weight of each element and that seems to be working fine but my first bool mask is not working. It appears as if the list going into the filter is the issue but it works fine for the other two branches. CraneRadius_ABro_Rev02 is my most recent version and the only place the filter fails is the top branch. Does anyone have any idea why this might be?

Thank,

Drew

Drew

Sorry, i was pretty busy over the weekend.

Try using the attached updated version i am currently using. I have added in groups and notes. Have a read of them all, hopefully they should all make sense.

CraneRadius_ABro_Rev04

Ive added in a bit to get a calculation of “x*y” for your volume if you need. Just input the parameters into the code blocks (it is all marked out and you should understand it easily enough) If you are using this part, make sure you run this first, but using the 2 Boolean at the very left hand side. Set the weight calc to True and the other one to false, then vice verca to run the main code.

Let me know if you have any issues.

I don’t know anything about Python Scripting or code writing, but I do recognize what would be nodes in your code block. Attached is a fragmented script where I am trying to replicate your code block using nodes for my own understanding of how it works. Can I trouble you to connect the dots? Please refer to the attached Dynamo file - Thanks

Color Override by Distance Away.dyn (16.4 KB)

@Bill_Mutert This discussion is old and there have been many developments since, I’m quite sure I’d approach this differently today. However, if you’re only looking at this as a Code to Node exercise. I’ve taken your attempt a little further. Didn’t complete it though.
Crane-nodes.dyn (20.2 KB)