Add mark to structural foundation and automatically tag

Hi there,

My name is Rob and i’m new to Dynamo.
In previous Revit versions I used revit Extensions to number structural foundations from left to right, and from top to bottom at the same time. Unfortunately Autodesk isn’t going to roll out this extension for Revit 2019 so I’m looking for a new way to do this. I’ve been advised to write a dynamo script since it would be a lot of work to do this manually (mark over 300 structural foundations)

I’ve already managed to number the structural foundations but they don’t get numbered the way I want to (from left to right, and top to bottom.
I also found a lot of sort of similar problems but I can’t get to the solution to fix my problem.

The second problem is that I would like to automatically tag the foundation. So for example the top left foundation pile will be named 01, and will be tagged with

Is there anyone that can help me?

Rob

Renumbering has been solved a few times. Try this one: Renumber Piles left to right or top to bottom

There are also multiple examples of tagging - check the forum for those and you should be squared away.

Thanks Jacob,

I’ve used the topic you’ve mentioned. I now got it right up till the end. the Element.SetParameterByName gives an error: Warning: No function called SetParameterByName on a _SingleFunctionObject that takes string,__array could be found.

What can I do to fix this last error

It might be that you left a space in the string node, after Mark. Usually I use Code Block with quotation marks, so you better see what happens.

If this is not the problem, can you expand the node List.Flatten? Are those all elements?

1 Like

Hi Luca,

I just replaced the string for a code block, and what I see is that the List.Flatten says _SingleFunctionObject, and as a result of that the list count only says 1 instead of 9. I thin the list flatten isn’t working properly because 1 step before that the List.SortbyKey give’s me the correct information. (see attachment). I’ve also tried your solution and that works fine but then I still have the problem with the (sort of) randomly numbering…

The element.SetParameterByName still gives the same error as described in the first post

You need to connect an integer to List.Flatten amt input. Try with 1 or 2 and see what happens :wink:

Hi @rjmgerri

Since you’re using Dynamo 0.9.x Flatten node will do the job here to flatten list.

Thanks @lucamanzoni @kulkul

Both solutions work, but now I’ve got some new problems, when I move or add/delete structural foundations I get 3 new errors (with both solutions). In the preview is

the solution of @kulkul because that’s the one I tried the second time.
The errors:

  1. List.SortyByKey: Warning: List.SortByKey operation failed. Number of items does not match the number of keys.
  2. List.Count: Warning: List.Count operation failed.
  3. Warning: Internal error, please report: Dereferencing a non-pointer. (3f47aacd)

Could you show preview for all the nodes.

I guess it’s a problem of levels, you can try with a flatten before the first yellow node (List.SortByKey). Sometimes if you modify something in Revit you also need to close Dynamo and reopen.
One question: why don’t you update Dynamo?

Thanks @lucamanzoni

The reason why I am using an older version of dynamo is because i;m working with dynamo at school and at home. At home I got the newest version but at school i’m not allowed to update any software so I have to do it with the old version to still be able to use and make changes at both places. I’ve already placed a request at school to update the sofware but you know how that goes…

Woah! Good eyes @lucamanzoni!

@rjmgerri - It appears you’re using a dynamo version which predates 1.2. If your intent is to build a graph that works with 2019+ you need to update to 2.0.1 or even the daily build for 2.1.0 to keep from having to rebuild your work.

1 Like

Thanks @JacobSmall

I think i’m going to start it over at home so I can use the latest version and hope the errors will stay away. I will let you guys now if it works better

1 Like

I’ve just updated my dynamo to the latest version and now I’ve got the same problem as I described in my last post. As you may see I’ve tried @lucamanzoni 's tip to place a before the first yellow node, but as you can see it doesn’t give any input anymore after this step. Can you guys help me again maybe?Capture

It doesn’t work because you connected to List.Flatten amt Input the list of points, instead of connecting them to Key input of SortByKeys.

It’s working again, I can’t thank you guys enough

rjmgerri, what was the solution of this problem. Could you share the working .dyn file