Filter list add prefix

Hi Guys,

 

I’m pretty new to Dynamo and visual programing, so please bear with me.

I am trying to add 2 prefixes to room numbers, a level prefix and a department prefix.

In my head this should be pretty simple.

List all rooms. Filter by level and Filter by department. Get all room numbers that have level x and department y. Combine list. Add prefix. Push back to model.

or

List all rooms. Add prefix(A) to Number parameter IF department=Any.

or

Export list to Excel add prefix manually, import from Excel push back to Revit… Haven’t looked at it as I wanted to automate it, and I can use an addin to export/import the schedule.

I am sure there something simple that I am missing, but I have been looking at it for a couple of days and it isn’t really getting through my head.

So far, all I have is this.

 

 

Graph01

 

See if this helps…

File: ReplaceMultiple.dyn

20160511-5

Hi Vikram,

Thanks for that, it looks ideal. However, the first code block that joins the parameters doesn’t seem to be working for me. It only picks one element at random.

 

If I try it with only 1 parameter like “Level”, then it messes up at string join.

It’s been a long day, so I am sure I am missing something simple, but thanks again.

 

g1

 

 

 

 

g1a

Hi Sam,

For the first code you need to change lacing to cross product for “Element.GetParameter” node.

Check the lacing on Element.GetParameterByName node. Lacing in dynamo primer: http://dynamoprimer.com/06_Designing-with-Lists/6-1_whats-a-list.html

Edit: Kulkul was faster (as usual)

Thanks Einar, that helped, though it is taking me a bit to get my head around lacing.

 

Thanks Kulkul, that did the trick. Next problem is getting this back into Revit.

Thank you all for the help so far.

I’ve managed to compile a list that looks like a room number i need, now I am not sure how to get that back into Revit.

The list I started with and the list I got in the end, are no longer in the same order, so even though I can send some of the data back using the Element.Set.Parameter.By.Name it doesn’t come back in the correct room.

I suppose I could use write to excel as a way of somehow organizing this, but I was really hoping to automate it without going through that process.

 

 

 

 

 

 

 

 

 

 

 

I probably shouldn’t have started this right before a deadline :slight_smile: