# Access revit toolbar

**URL:** <https://forum.dynamobim.com/t/access-revit-toolbar/91546>\
**Category:** Revit\
**Tags:** revit, dynamo\
**Created:** [July 7, 2023, 12:56pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546 "2023-07-07T12:56:46Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![cintiamiranda21](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cintiamiranda21/32/161500_2.png) [@cintiamiranda21](https://forum.dynamobim.com/u/cintiamiranda21)\
**Post date:** [July 7, 2023, 12:56pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/1 "2023-07-07T12:56:46Z")

</div>

I searched and didn’t find anything about it. Does anyone know how to create an environment delimited by model elements? Creating environments is done through the Revit toolbar - Architecture - Environment. Or how to access this tool in Revit using Dynamo? I’m going to create a routine with Passthrough, but I need this step for the others. Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 7, 2023, 2:29pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/2 "2023-07-07T14:29:22Z")

</div>

> [@cintiamiranda21](#):
>
> Creating environments is done through the Revit toolbar - Architecture - Environment.

Where exactly? I don’t see anything in the toolbar for environment, perhaps it’s a translation issue?

This is my Architecture menu in Revit 2024 (2022 is the same items but with a different look).

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/2/a28b2d8c825604291f6b958bea0d66dde6b11024.png)

---

<div class="post-metadata">

**Author:** ![cintiamiranda21](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cintiamiranda21/32/161500_2.png) [@cintiamiranda21](https://forum.dynamobim.com/u/cintiamiranda21)\
**Post date:** [July 7, 2023, 4:06pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/3 "2023-07-07T16:06:55Z")

</div>

That’s strange. See where it is located. But anyway, is it possible to access a Revit tool and execute it through Dynamo?

 ![Captura de Tela (38)](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/e/9e1aa2a52a04bd19f38af90d80baf98e2d07e9ca.jpeg)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 7, 2023, 4:20pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/4 "2023-07-07T16:20:28Z")

</div>

Ah. In English that is the new room tool. So that’d be a translation issue. 🙂

You can’t call on the toolbar directly, but you can create a room using Dynamo as shown here: [Dynamo Dictionary](https://dictionary.dynamobim.com/#/Revit/Elements/Room/Create/ByLocation)

---

<div class="post-metadata">

**Author:** ![cintiamiranda21](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cintiamiranda21/32/161500_2.png) [@cintiamiranda21](https://forum.dynamobim.com/u/cintiamiranda21)\
**Post date:** [July 7, 2023, 4:38pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/5 "2023-07-07T16:38:51Z")

</div>

It doesn’t work because it asks to select points on the face, but there is no face yet. I have to create the environment specifically for that purpose, so that the next routines can identify the area of the environment. There are only walls, so the routine should identify the delimited areas between the walls and create the environment. Do you know how I could do that?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 7, 2023, 5:27pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/6 "2023-07-07T17:27:10Z")

</div>

> [@cintiamiranda21](#):
>
> There are only walls,

So all walls have been created, and each cell of enclosed space wants to create a new room?

If so this is the API method you need (or one of the similar methods):

> **[NewRooms2 Method (Level)](https://www.revitapidocs.com/2023/5d5f7f56-c86c-d87e-ff6c-eb4e465a5183.htm)**
>
> Online Documentation for Autodesk's Revit API: 2015, 2016, 2017, 2017.1, 2018

Give it a shot and shee where you get.

---

<div class="post-metadata">

**Author:** ![cintiamiranda21](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cintiamiranda21/32/161500_2.png) [@cintiamiranda21](https://forum.dynamobim.com/u/cintiamiranda21)\
**Post date:** [July 7, 2023, 6:10pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/7 "2023-07-07T18:10:55Z")

</div>

This is one of my attempts, but I am not succeeding.

 ![Capturar07](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/4/94479019b87e03e5416f428de34360bb9a899f5a.jpeg)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 7, 2023, 6:25pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/8 "2023-07-07T18:25:21Z")

</div>

Looks like someone has posted some Python which should do what you need in this thread: [Creating Rooms from Spaces - #7 by dineshsubramani](https://forum.dynamobim.com/t/creating-rooms-from-spaces/46669/7)

Try implementing that, and reply here so we know where you get. 🙂

---

<div class="post-metadata">

**Author:** ![cintiamiranda21](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cintiamiranda21/32/161500_2.png) [@cintiamiranda21](https://forum.dynamobim.com/u/cintiamiranda21)\
**Post date:** [July 8, 2023, 7:08pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/9 "2023-07-08T19:08:44Z")

</div>

I couldn’t, the code just gives error. Do you know what it could be?

 ![Captura de Tela (111)](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/d/8d7673fb45df7a181903e129704a9e940d9b82b7.jpeg)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 8, 2023, 7:26pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/10 "2023-07-08T19:26:03Z")

</div>

Try implementing the UnWrap method. More here:

> **[4.4 Unwrapping Revit Elements](https://dynamopythonprimer.gitbook.io/dynamo-python-primer/4-revit-specific-topics/unwrapping-revit-elements)**
>
> Revit elements are like bananas - best unwrapped before they are consumed ��

---

<div class="post-metadata">

**Author:** ![cintiamiranda21](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cintiamiranda21/32/161500_2.png) [@cintiamiranda21](https://forum.dynamobim.com/u/cintiamiranda21)\
**Post date:** [July 9, 2023, 7:33pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/11 "2023-07-09T19:33:56Z")

</div>

It could not be simpler? Without using python?  
Because in fact I’m not succeeding and I’m trying through nodes only, with the intention of taking the walls created in revit, identifying the areas between them, and creating an environment. It would be possible?

 ![Captura de Tela (113)](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/d/6dcda232291cc5043537dfbee5b9a6199b941ac2.jpeg)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 9, 2023, 8:19pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/12 "2023-07-09T20:19:55Z")

</div>

I do t know any package which has this built in unfortunately.

Once you get the Python it’s pretty straight forward. If you join the unwrap and the code in the link I posted it should work. Work with the code line by line, commenting out as you go. When you get stuck like this and have to implement a new tech it’s a chance to learn. Going over the Dynamo Python primer I previously linked you will help. Do each exercise one by one, skipping nothing. Each exercise is foundational to help you get past these types of hurdles. There is also the Dynamo office hours #18 and 28 here: [Dynamo Office Hours - YouTube](https://m.youtube.com/playlist?list=PLdlF7MirPEC2yNFTGymESd3t7Xosfk9c2)

I’ll try and post something Monday when I get back to my PC.

---

<div class="post-metadata">

**Author:** ![gerhard.p](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gerhard.p/32/147675_2.png) [@gerhard.p](https://forum.dynamobim.com/u/gerhard.p)\
**Post date:** [July 9, 2023, 8:51pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/13 "2023-07-09T20:51:44Z")

</div>

The code works for me.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/b/8b4252eb76017e17a6865c3badfcef085b0b1f25.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/2/c2372a6b72fc3cbbcac5ff44923efda7e8d0936e.png)

```auto
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

levels = UnwrapElement(IN[0])
newRoomList = []

TransactionManager.Instance.EnsureInTransaction(doc)

for level in levels:
		newRoom = doc.Create.NewRooms2(level)
		for r in newRoom:
			newRoomList.append(doc.GetElement(r))
					
TransactionManager.Instance.TransactionTaskDone()
OUT = newRoomList

```

---

<div class="post-metadata">

**Author:** ![cintiamiranda21](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cintiamiranda21/32/161500_2.png) [@cintiamiranda21](https://forum.dynamobim.com/u/cintiamiranda21)\
**Post date:** [July 9, 2023, 11:04pm UTC](https://forum.dynamobim.com/t/access-revit-toolbar/91546/14 "2023-07-09T23:04:48Z")

</div>

Yes. Now yes. I was wrong to use the code block.  
Thanks!
