This is my first post in the forum and I am also new to Dynamo. I have tried to search in the forum but no luck.
What I want is simple. I have walls in my Revit model and I just want to create wall reveals on it.
I have tried to search a node for reveals with no luck. I can select the reveal type but don’t know what to do next.
there is a first part to get the reveal type by name :
import clr
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Electrical import*
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
doc = DocumentManager.Instance.CurrentDBDocument
collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Reveals)
traytype = [x for x in collector if x.ToDSType(True).Name == IN[0]]
OUT = traytype[0]
then the second part of the workflow is to create the reveals:
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
if isinstance(IN[0],list):
walls = [UnwrapElement(i) for i in IN[0]]
else:
walls = [UnwrapElement(IN[0])]
wstype = ElementId(IN[1].Id)
sr = IN[2]
vertical = IN[3]
UIunit = Document.GetUnits(doc).GetFormatOptions(UnitType.UT_Length).DisplayUnits
dist = UnitUtils.ConvertToInternalUnits(IN[4],UIunit)
#creating wallsweepinfo
if not sr:
wsi = WallSweepInfo(WallSweepType.Sweep,vertical)
else:
wsi = WallSweepInfo(WallSweepType.Reveal,vertical)
#setting distance of sweep
wsi.Distance = dist
#creating wallsweep
TransactionManager.Instance.EnsureInTransaction(doc)
ws = []
for w in walls:
ws.append(WallSweep.Create(w,wstype,wsi))
TransactionManager.Instance.TransactionTaskDone()
OUT = ws
Hello Mostafa.
I’m trying to make this node from Data-Shapes package work, but i can’t. I think it’s because of the sweep/reveal type. I’m using a code block node with the name of one of several sweep types i have created in Revit between quotes but i get nothing. No error messages, only null.
What is happening?
Please, i need some help.
I’ve just try it but not, i get the same elements than using “Wall”. That is only for discarding floors from room boundaries.
Do you get the sweeps using the same program than me?
That’s ok. At last i’ve got it. Thank you very much.
Although i haven’t used Element.Name, only Element.Type. But that forces you to create manually a sweep. Doesn’t matter.
Now there is another problem; how could i make it select the correct face of the wall?
Yes, i have noticed that “WallSweepOnWall” node creates all sweeps on the exterior face of the wall. It would be nice to include a parameter for choosing the face where it will be created on.
That will be useful with regular profiles but not with more complex ones.
I will keep on trying to get it. I don’t know python programming, so if someone wants to help it would be great.
Hello @Mostafa_El_Ayoubi,
I’m trying to get the skinting-boards by rooms. If i use wall sweeps i find some problems: first, i need to place them in the wall face that faces the room, so as i wrote before, your great node should include the option to choose the inner or outter wall face to place it. The second problem is that walls may run along several rooms and if i don’t want to place skirting-boards in those rooms i’d had to modify the length manually.
Other way to get this is creating “solids by sweep” and “direct shapes”, but it’s no longer possible to get the information by schedules.
If you have any suggestion it will be great.
Thanks in advance.