# Making rebar solid

**URL:** <https://forum.dynamobim.com/t/making-rebar-solid/3214>\
**Category:** Revit\
**Tags:** dynamoforrebar\
**Created:** [February 18, 2016, 11:17am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214 "2016-02-18T11:17:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Ratcliff](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Mark\_Ratcliff](https://forum.dynamobim.com/u/Mark_Ratcliff)\
**Post date:** [February 18, 2016, 11:17am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/1 "2016-02-18T11:17:49Z")

</div>

![solid](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/b/bb793b7dc7430673d679c0f3ee98c1cd0efb4af2.png)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

Can anyone tell me why this isn’t working?

I am using Revit 2016 R2 Update 2 , Dynamo 0.9.1.4062, Dynamo for rebar 0.2.7

I’m trying to toggle the appearance of rebar in the current view between solid and line. If I put the same code in a script that creates rebar it works. But this doesn’t when I select existing rebar.

Thanks for your help.

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Pal\_Roe\_Larsen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pal_roe_larsen/32/9501_2.png) [@Pal\_Roe\_Larsen](https://forum.dynamobim.com/u/Pal_Roe_Larsen)\
**Post date:** [March 7, 2016, 9:43am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/2 "2016-03-07T09:43:14Z")

</div>

I’ve had some similair issues, but from Dieter Vermeulen’s blog I’ve found a solution that works flawlessly for me:

&nbsp;

 ![set solid](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/4/44f15dce26b6aa8fb6ce3bfcd4eb4f4e4f4c98ca.png)

---

<div class="post-metadata">

**Author:** ![Eduardo\_Dilo](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@Eduardo\_Dilo](https://forum.dynamobim.com/u/Eduardo_Dilo)\
**Post date:** [April 17, 2016, 12:50pm UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/3 "2016-04-17T12:50:57Z")

</div>

Hello, the code doesn’t work for me using it in a existing rebar. Someone did it work ?

---

<div class="post-metadata">

**Author:** ![Pal\_Roe\_Larsen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pal_roe_larsen/32/9501_2.png) [@Pal\_Roe\_Larsen](https://forum.dynamobim.com/u/Pal_Roe_Larsen)\
**Post date:** [April 18, 2016, 5:15am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/4 "2016-04-18T05:15:48Z")

</div>

To get existing bars in Revit to appear as solid you have to change it in Revit.

&nbsp;

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

---

<div class="post-metadata">

**Author:** ![Eduardo\_Dilo](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@Eduardo\_Dilo](https://forum.dynamobim.com/u/Eduardo_Dilo)\
**Post date:** [April 18, 2016, 1:29pm UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/5 "2016-04-18T13:29:07Z")

</div>

PÅL RØE LARSEN:

Thanks, but I want to make it automaticaly from Dynamo.

Check out this video. In there, he is able to do it automaticaly with dynamo aparently.

Thanks in advance

&nbsp;

---

<div class="post-metadata">

**Author:** ![Pal\_Roe\_Larsen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pal_roe_larsen/32/9501_2.png) [@Pal\_Roe\_Larsen](https://forum.dynamobim.com/u/Pal_Roe_Larsen)\
**Post date:** [April 19, 2016, 1:15am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/6 "2016-04-19T01:15:50Z")

</div>

Hmm. I’ve never seen that interface before, but I really don’t feel its much different though.

In my work I’m using either the Dynamo-code I posted or the View Visibility Settings in Revit, which works fine with me 🙂

---

<div class="post-metadata">

**Author:** ![Eduardo\_Dilo](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@Eduardo\_Dilo](https://forum.dynamobim.com/u/Eduardo_Dilo)\
**Post date:** [April 19, 2016, 11:33am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/7 "2016-04-19T11:33:55Z")

</div>

Thank you for your response.

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [June 30, 2016, 10:24pm UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/8 "2016-06-30T22:24:22Z")

</div>

@Eduardo_Dilo  
If you’re still interested, see this issue [https://github.com/tt-acm/DynamoForRebar/issues/72](https://github.com/tt-acm/DynamoForRebar/issues/72)

Try this custom node until it’s fixed:  
[Rebar.SetSolidInView.dyf](https://forum.dynamobim.com/uploads/short-url/yJzGKY9DKhPxcx7wAHSmXyV2bC3.dyf) (3.8 KB)

---

<div class="post-metadata">

**Author:** ![Jorge\_Villarroel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jorge_villarroel/32/23619_2.png) [@Jorge\_Villarroel](https://forum.dynamobim.com/u/Jorge_Villarroel)\
**Post date:** [August 18, 2016, 12:36pm UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/9 "2016-08-18T12:36:51Z")

</div>

Hi PÄl, I’m trying to use your script for all of the bars in the 3D view. This is like my script looks like. Why isn’t working?

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/d/d641ab073cfe16ac5e07efd57ff3c99f18b216fb.png)

---

<div class="post-metadata">

**Author:** ![Pal\_Roe\_Larsen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pal_roe_larsen/32/9501_2.png) [@Pal\_Roe\_Larsen](https://forum.dynamobim.com/u/Pal_Roe_Larsen)\
**Post date:** [August 18, 2016, 1:01pm UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/10 "2016-08-18T13:01:29Z")

</div>

I think the fault lies in your _Rebar_ input in the _Rebar.SetUnobscureInView_ node. As you can see in my post from March 7th I input the Rebar outputted from the _Rebar.ByCurve_ node into the SetSolid node. I see that you use an Element Types node. Try switching to your output from the _Rebar.ByCurve_ node. That should do it I think 🙂

---

<div class="post-metadata">

**Author:** ![Jorge\_Villarroel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jorge_villarroel/32/23619_2.png) [@Jorge\_Villarroel](https://forum.dynamobim.com/u/Jorge_Villarroel)\
**Post date:** [August 18, 2016, 1:15pm UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/11 "2016-08-18T13:15:58Z")

</div>

Yes, I saw that, but I’m trying to do this through a rebar which is already placed in my model, not created though Dynamo. Is it only working witch bars created through Dynamo?

Thanks!

---

<div class="post-metadata">

**Author:** ![Pal\_Roe\_Larsen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pal_roe_larsen/32/9501_2.png) [@Pal\_Roe\_Larsen](https://forum.dynamobim.com/u/Pal_Roe_Larsen)\
**Post date:** [August 18, 2016, 2:07pm UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/12 "2016-08-18T14:07:02Z")

</div>

Aah, ok. Hmm, I think my method only works with rebar generated from Dynamo. However, Im pretty shure Dynamo can handle existing rebar. I have not tried it though 😕

---

<div class="post-metadata">

**Author:** ![Jorge\_Villarroel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jorge_villarroel/32/23619_2.png) [@Jorge\_Villarroel](https://forum.dynamobim.com/u/Jorge_Villarroel)\
**Post date:** [August 18, 2016, 2:19pm UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/13 "2016-08-18T14:19:07Z")

</div>

Thanks! If I find the way… I’ll post it!

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [August 18, 2016, 6:36pm UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/14 "2016-08-18T18:36:39Z")

</div>

Hello @Jorge_Villarroel , you can use the attached custom node or the below python script to set the rebar unobscured in view.

[Rebar.SetUnobscuredInView.dyf](https://forum.dynamobim.com/uploads/short-url/kW0nkkdhX1BycjvwLr2oRHmJZ7k.dyf) (3.7 KB)

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/c/c5cff3a3974c3223b0122c9b2f511ffbba230ff2.png)

```
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference("System")
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

#Preparing input from dynamo to revit
rebarElements = UnwrapElement(IN[0])
views = UnwrapElement(IN[1])

#Change rebar in transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for view in views:
	for rebarElement in rebarElements:
		rebarElement.SetUnobscuredInView(view,1)
TransactionManager.Instance.TransactionTaskDone()

OUT = rebarElements
```

---

<div class="post-metadata">

**Author:** ![Jorge\_Villarroel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jorge_villarroel/32/23619_2.png) [@Jorge\_Villarroel](https://forum.dynamobim.com/u/Jorge_Villarroel)\
**Post date:** [August 18, 2016, 6:47pm UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/15 "2016-08-18T18:47:54Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![Brenden\_Picton](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@Brenden\_Picton](https://forum.dynamobim.com/u/Brenden_Picton)\
**Post date:** [August 22, 2016, 7:50am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/16 "2016-08-22T07:50:47Z")

</div>

Hi @Einar_Raknes,

I’ve tried inputing your code and I’m getting the following error:

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.  
Traceback (most recent call last):  
File “”, line 29, in   
TypeError: iteration over non-sequence of type View3D

Any Ideas?

Cheers  
Brenden

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [August 22, 2016, 8:11am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/17 "2016-08-22T08:11:31Z")

</div>

Hi Brenden,

Can you show us complete screenshot of your graph?

---

<div class="post-metadata">

**Author:** ![Einar\_Raknes](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/einar_raknes/32/8566_2.png) [@Einar\_Raknes](https://forum.dynamobim.com/u/Einar_Raknes)\
**Post date:** [August 22, 2016, 8:12am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/18 "2016-08-22T08:12:08Z")

</div>

@Brenden_Picton The view must be in a list.Use List.Create or `{ 3d };` in a codeblock. If you download the custom node, it will take care of this for you.

---

<div class="post-metadata">

**Author:** ![Brenden\_Picton](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@Brenden\_Picton](https://forum.dynamobim.com/u/Brenden_Picton)\
**Post date:** [August 22, 2016, 8:55am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/19 "2016-08-22T08:55:48Z")

</div>

@Einar_Raknes,

Works perfect now, thankyou.

Cheers,  
Brenden

---

<div class="post-metadata">

**Author:** ![nedlind](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nedlind/32/14399_2.png) [@nedlind](https://forum.dynamobim.com/u/nedlind)\
**Post date:** [September 30, 2016, 10:55am UTC](https://forum.dynamobim.com/t/making-rebar-solid/3214/20 "2016-09-30T10:55:27Z")

</div>

Thanks for sharing your code, @Einar_Raknes.  
I made some improvements for my implementation and thought I’d post it back.  
It now accepts single rebar objects and selections that include other objects.

import clr

clr.AddReference(‘RevitAPI’)  
from Autodesk.Revit.DB import \*  
from Autodesk.Revit.DB.Structure import \*

clr.AddReference(“System”)  
from System.Collections.Generic import List

clr.AddReference(‘RevitNodes’)  
import Revit  
clr.ImportExtensions(Revit.GeometryConversion)  
clr.ImportExtensions(Revit.Elements)

clr.AddReference(‘RevitServices’)  
import RevitServices  
from RevitServices.Persistence import DocumentManager  
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

#Preparing input from dynamo to revit  
rebarElements = UnwrapElement(IN[0])  
views = UnwrapElement(IN[1])

#Change rebar in transaction  
TransactionManager.Instance.EnsureInTransaction(doc)  
for view in views:  
#Check if single rebar is selected  
if type(rebarElements). **name** == “Rebar”:  
rebarElements.SetSolidInView(view,1)   
else:   
for rebarElement in rebarElements:  
#Check if object is rebar  
if type(rebarElement). **name** == “Rebar”:  
rebarElement.SetSolidInView(view,1)

TransactionManager.Instance.TransactionTaskDone()

OUT = rebarElements

[Next page](https://forum.dynamobim.com/t/making-rebar-solid/3214.md?page=2)
