Rendering issues while Creating a Room

Rendering issues while Creating a Room

Anonymous
Not applicable
427 Views
2 Replies
Message 1 of 3

Rendering issues while Creating a Room

Anonymous
Not applicable

I am using this code to create a Room in Revit. It successfully creates the Room but is invisible and is only visible when I take the mouse over it. Once you remove the mouse the Room disappears. Could somebody let me know what is wrong with the code below.

 

Document document = commandData.Application.ActiveUIDocument.Document;

using (Transaction trans = new Transaction(document, "CreateRoom"))
{
trans.Start();
double elevation = 1.0;
Level level1 = Level.Create(document, elevation);
UV point2D = new UV(10, 10);
Room room = document.Create.NewRoom(level1, point2D);
if (room == null)
{
return Result.Failed;
}
trans.Commit();
return Result.Succeeded;
}

0 Likes
Accepted solutions (1)
428 Views
2 Replies
Replies (2)
Message 2 of 3

WhiteSharx
Contributor
Contributor

The code is OK, IMHO.

Possibly you just need to make visible rooms references in visibility/graphics overrides

0 Likes
Message 3 of 3

JimJia
Alumni
Alumni
Accepted solution

Yes, the code works well per my verify/

I found the API-created room works same with UI-created room: room will be visible and highlighted automatically when mouse hovers over it.

I don't find problem of API room, please help to clarify or correct.


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com