I’ve been reading and studying the post dividing parts with dynamo
As I am new to python, i’m unsure on what to amend so that it divides the internal part of the wall not the entire wall.
Additionally… I also need to then split the result horizontally (Forming panels)
Any help would be appreciated.
Thank you.
Eddie
1 Like
Below is the original script which I subsequently tweaked to selected the already generated part.
Tweaked script.
The embedded python script is where I’m stuck (Python newbie)
-
import clr
-
clr.AddReference(‘RevitAPI’)
-
from Autodesk.Revit.DB 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
-
wall = UnwrapElement(IN[0])
-
divisionLines = [l.ToRevitType(True) for l in IN[1]]
-
sketchPlane = UnwrapElement(IN[2])
-
#Create a list for the wall and the divisionLines
-
wallList = ListElementId
-
wallList.Add(wall.Id)
-
intersectionElementsIds = ListElementId
-
curveArray = ListCurve
-
#All actions that makes changes to the Revit database needs to be inside a Transaction
-
TransactionManager.Instance.EnsureInTransaction(doc)
-
if PartUtils.AreElementsValidForCreateParts(doc, wallList):
-
createParts = PartUtils.CreateParts(doc, wallList)
-
doc.Regenerate()
-
parts = PartUtils.GetAssociatedParts(doc, wall.Id, 0, 0)
-
partDivide = PartUtils.DivideParts(doc, parts, intersectionElementsIds, curveArray, sketchPlane.Id)
-
TransactionManager.Instance.TransactionTaskDone()
-
OUT = partDivide
I would like on the selected part to be divided not the entire wall.
Any help would be appreciated.
I’ve attached the DYN partDivisionLines.dyn (47.8 KB)
I’ve resolved my own issue…
Hi EddieSaez, So whats the solution you have resolved would you care to share to the public?
Original_Gemini.
Apologies but I can’t recall what the solution was.
I’d have go back over the python code over all graph/script
Could you share your script?
Original_Gemini, lucas-gsbp
See attached file… Runs in Dynamo 2.0
Wall must be converted to parts prior to running.
On Running select the parts to divide/split, then the start point of the division
Divide-PartsIntoPanels.dyn (67.9 KB)
1 Like