Announcements
Welcome to the Revit Ideas Board! Before posting, please read the helpful tips here. Thank you for your Ideas!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

View Rooms and Spaces in 3D

View Rooms and Spaces in 3D

It would be great to be able to view rooms and spaces in 3D views, and assign color schemes to the views.  This would assist with pinning down bounding issues, as well as allowing us to create things like stacked isometrics to convey how a building functions.

58 Comments
►BIM-Roman◄
Participant

Level 3D - done, Grids 3D - Done. what about 3D rooms?

Tags (1)
ankofl
Advocate

Well, the code that does what 760 people have been waiting for for seven years takes... 69 lines. Use this

 

using Autodesk.Revit.DB.Mechanical;
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rooms3D
{
    [Transaction(TransactionMode.Manual)]
    public class Switch : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            Document doc = commandData.Application.ActiveUIDocument.Document;

            Transaction ts = new Transaction(doc, "3D Spaces");
            ts.Start();

            BuiltInCategory bic = BuiltInCategory.OST_Signage;

            IList<Element> listElem = new FilteredElementCollector(doc).OfCategory(bic).WhereElementIsNotElementType().ToElements();

            bool clearModel = false;
            List<ElementId> ToDel = new List<ElementId>();
            foreach (Element  oldShape in listElem)
            {
                string comment = oldShape.get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS).AsString();
                if (comment != null && comment.Contains(" "))
                {
                    if (!clearModel)
                    {
                        clearModel = true;
                    }

                    ToDel.Add(oldShape.Id);
                }
            }
            doc.Delete(ToDel);

            if(!clearModel)
            {
                List<Element> roomsAndSpaces = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_MEPSpaces).ToList();
                roomsAndSpaces.AddRange(new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Rooms));

                foreach (Element elem in roomsAndSpaces)
                {
                    try
                    {
                        Solid solid = (Solid)elem.get_Geometry(new Options()).ElementAt(0);

                        DirectShape ds1 = DirectShape.CreateElement(doc, new ElementId(bic));
                        ds1.AppendShape(new List<GeometryObject> { solid });
                        ds1.get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS).Set(elem.Name);
                    }
                    catch { }
                }
            }

            ts.Commit();

            return Result.Succeeded;
        }
    }
}

The first launch displays the premises, the second disables it. Each restart of the setting displays the geometry of the <Rooms> and <Spaces> that is relevant at the time of launch
@colin.magner @Anonymous @Anonymous @Anonymous @pieter1 

 

 

asWAPL9
Enthusiast

this is great!! thank you! can this be ran inside Dynamo?

ankofl
Advocate

Thanks!
I don't use Dynamo, but if you just need a working button in your interface, I can send you a link to the archive and installation instructions (I would post it right here, but I'm afraid of being banned for posting links to my application bypassing the Autodesk AppStore)

MichaelWolff
Advisor

@ankofl Thank you for your script. I would love to be sent a link to the archive on how to get your script running. I tried opening the macro manager, made a new module and exchanged the code for yours. Sadly, it does not seem to be that easy. Btw. I tried R19 and R23.

ankofl
Advocate

Hi @MichaelWolff 
I sent you a private message

Joeri_Slots
Explorer

@ankofl could you please send me the archive and (installation)instructions? thnx!

ankofl
Advocate

Hi @Joeri_Slots
I sent you a private message

Could you please a share a youtube video to urdestand how try this code?

ankofl
Advocate

Hi @rafael_silva_villanueva
Yes, I think I can do it tomorrow

ankofl
Advocate

Hi @rafael_silva_villanueva !

I think it would be redundant to create a YouTube video for such a modest functionality, so I'll post the instructions here. Before installing, you need to close all open Revit. Then put the following three files ( CustomCFG.dll , Rooms3D.dll , Rooms 3D.addins ) to the folder:
"C:\Users\<UserName>\AppData\Roaming\Autodesk\Revit\Addins\20<YourVersionRevit>\" 

ankofl_0-1708074568281.png

Then you need to start Revit. At the first launch, you will be asked whether to download the previously installed add-on: click "AlwaysLoad".

ankofl_1-1708074672837.png

Then, after downloading, open the project that contains the hosted Rooms and Spaces.

Open the 3D view, go to the "Addins" tab, click on the "ExternalTools" tab that appears and click the "Rooms3D.Switch" drop-down button for the first time.

2.jpg

This click will create the geometry of all the placed Rooms and Spaces in the model.

1.jpg

The second click on the same button clears the model from the created forms.

The form is created in the "Signage" category, and the number and name of the Room or Space to which the form belongs are recorded in the "Commants".

ankofl_3-1708075214387.png

Important!

The form is relevant only at the time of creation, and is not dynamically linked to the model. I.e., if you change the height of the Room or Space, to update the form you will need to clear the model and create the forms again by clicking the "Rooms3D.Switch" button twice in a row

I hope it will be useful for you! Have a nice day!

@ankofl could you please send me the archive and (installation)instructions? it would be very much apreciated, thnx!

 

ankofl
Advocate

Hi @danielgerardo.gonzalez !
You can use the instructions in the comment above

Have a great day!

jonathan_larson
Contributor

I'm very surprised this hasn't been included in Revit yet. This would be very helpful in visualizing spaces/rooms with complex sloped ceilings.

rebeccacryder
Explorer

I was able to install the Addin.  However, Its not creating rooms in 3D.  Nothing is happening when i click Rooms3D.Switch. Can you advise on what the issue might be? 

 

ankofl
Advocate

Hi @rebeccacryder, sorry for the long answer
Could you send your rvt file that doesn't show rooms? Although perhaps the problem is that the "signs" category is disabled on your view, it is in it that the shape of the premises is created

MichaelWolff
Advisor

@rebeccacryder Make sure that you are using a Revit version that offers the category signs. I think they were introduced in 2023. The addin will in install in older versions of Revit despite the missing category. It just won't do anything.

MichaelWolff
Advisor

Just to be clear, while @ankofl's addin works well, the proper Revit entity room still does not show in 3D. @harlan_brumm Despite many of the original voters having turned anonymous now, I wonder how far this idea is from being implemented.

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Forma Design Contest


Technology Administrators