Programming? Visual Studio 2022?

I have to program this, and at the very bottom of the if, it's like this: You have a table with usage keys for rooms from Revit, and some, of course, have the same usage keys. There are 1-8. For all rooms with the usage key "2 Office Works," the area of ​​these rooms with the same usage key should be added together. I have if (room.RoomKey is "2 Office Works")

Now I have to write in these curly brackets that they should be added, but how? I've reprogrammed and I don't get it.

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
3 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Simor146
1 year ago

You set a variable outside the loop that should specify the whole size. Maybe “bureau” is for it, otherwise there would be a good place.

Then you just reckon in the loop

if (raum.Raumschlüssel is "2 Büroarbeit")
{
  büro = büro + raum.Fläche;  
}

If that’s what your Vairable means and what the size property means in the room.

instead

  büro = büro + raum.Fläche;  

you can also (quasi as an abbreviation)

  büro += raum.Fläche;  

write.

Simor146
1 year ago
Reply to  hahshus

Whatever the result outputs may be either only in the if condition (if you want intermediate results) or after the loop.
For a more accurate answer, I would have to see the current code.