Space Separator From Clockwork Node

Hi everyone, I’m trying to create Space separator from Curves, So using Clockwork node"SpaceSeparator.FromCurve" is not working, then I bring python script into my graph but it shows below warning. then basically I don’t python so can you Copy Element From Linked Model.dyn (30.6 KB)
please help me,!
2019-01-17%2015_38_54-Dynamo

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

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

doc = DocumentManager.Instance.CurrentDBDocument
curves = UnwrapElement(IN[0])
sketchplane = UnwrapElement(IN[1])
view = UnwrapElement(IN[2])

TransactionManager.Instance.EnsureInTransaction(doc)
curvearray = CurveArray()
for curve in curves:
curvearray.Append(curve.ToRevitType())
doccreation = doc.Create
separatorarray = doccreation.NewSpaceBoundaryLines(sketchplane, curvearray, view)
TransactionManager.Instance.TransactionTaskDone()

elementlist = list()
for item in separatorarray:
elementlist.append(item)
OUT = elementlist

Revit Version - 2015
Dynamo version - 1.2.1.3083

Hi @thiru2jack,

Can you show us the rest of the graph?
The warning says you’re a feeding a list of objects where it expected a sketchplane.

thank you Mr.@CVestesen but i dont know how to solve it…

i think the sketch plane can be a level

still,

it shows the same warning :disappointed_relieved:@Marcel_Rijsmus

can you draw a space separator in a 3d view in Revit???

1 Like

No. Try a plan view.

1 Like

@Andreas_Dieckmann
Thank you Andreas, Das war eine rhetorische Frage :slight_smile:

1 Like

It is telling you that it is not made for getting a list of sketchplanes… Your IN[1]

Edit… This is because it is made to be within a custom node which handles the iteration through dynamo

3 Likes

You either need to give it only ONE sketchplane, or you need to modify the code to iterate each plane with each curve in each view.

1 Like

Try using this one in your python script:

if isinstance(IN[1], list):
unwrappedList = [UnwrapElement(i) for i in IN[1]]
else:
unwrappedList = [UnwrapElement(IN[1])]

2 Likes

yes, @SeanP I did each plane for each Curve but now it shows this error.

image

Sorry For late reply, i did this changes for curves and sketchplane but it shows the same error so iterate each sketchplane for each curve but it shows image

Can you share the code again? :slight_smile:

2 Likes

yes,

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

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

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

doc = DocumentManager.Instance.CurrentDBDocument

view = UnwrapElement(IN[2])

if isinstance(IN[1], list):
curves = UnwrapElement(IN[1])
else:
curves = [UnwrapElement(IN[1])]

if isinstance(IN[1], list):
sketchplane = UnwrapElement(IN[1])
else:
sketchplane = [UnwrapElement(IN[1])]

TransactionManager.Instance.EnsureInTransaction(doc)
curvearray = CurveArray()
for curve in curves:
curvearray.Append(curve.ToRevitType())
doccreation = doc.Create
separatorarray = doccreation.NewSpaceBoundaryLines(sketchplane, curvearray, view)
TransactionManager.Instance.TransactionTaskDone()

elementlist = list()
for item in separatorarray:
elementlist.append(item)
OUT = elementlist

Copy Element From Linked Model.dyn (71.7 KB)

You have the sketchplane and the curves coming in on IN[1] in the code above. Change the curves to IN[0] and see if that works.

1 Like

no, it shows the same the error,

separatorarray = doccreation.NewSpaceBoundaryLines(sketchplane,curvearray, view)

this line is correct or not ??

where do i check?

separatorarray = doccreation.NewSpaceBoundaryLines(sketchplane,curvearray, view)

these three variables are only needed or these variables are correct order ??

It appears to be in the correct order.

http://www.revitapidocs.com/2016/e95433bf-3440-50e3-c9d0-c5559fbb0aff.htm

However, I think k your list structures aren’t working right. You have nested lists of curves coming in, but you only iterate o er them all one time. IE: Curve List 0 has 4 curves in it, but you never get curve[0][1]. You just add them all to curvearray. Try to work through your lists and make sure they are all matching and at the same level.

i tried, Nested curves with 4 plane and Nested Curves with Nested Planes and also change the views but
i can’t find the error


but i try with model line. it’s working

use an areaplan as view