Making rebar solid

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

 

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

 

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 :slight_smile:

Thank you for your response.

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

Try this custom node until it’s fixed:
Rebar.SetSolidInView.dyf (3.8 KB)

1 Like

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?

1 Like

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 :slight_smile:

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!

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 :confused:

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

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 (3.7 KB)

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
1 Like

Thanks!

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

Hi Brenden,

Can you show us complete screenshot of your graph?

@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.

@Einar_Raknes,

Works perfect now, thankyou.

Cheers,
Brenden

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

Nice work. You can get better formatting with the </> symbol

Was looking for that. Gotta get my glasses cleaned. Thanks.

Niklas Edlind

Project Manager

StruSoft AB

How can you do something similar but to verify if a rebar “IsUnobscuredInView”?