Hi
I am trying to create chamfered wires with dynamo, inputing connectors, and vertexpoints etc.
I have made the python script to create the wires myself, and I cannot get it to work.
When I try to run the script I get a peculiar error.
What causes this error, and is it possible to work around it?
Here is the python script (code pasted in bottom of post), along with the relevant inputs from the graph:
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Electrical import *
clr.AddReference('DSCoreNodes')
import DSCore
from DSCore.List import *
import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
connectors = IN[0]
vrtxpts = UnwrapElement(IN[1])
wiretyp = UnwrapElement(IN[2])
curview = UnwrapElement(IN[3])
doc = DocumentManager.Instance.CurrentDBDocument
wireTypeId = wiretyp[0].Id
view = curview.Id
wiringType = WiringType.Chamfer
vertexPts = vrtxpts
sConnector = connectors[0]
eConnector = connectors[1]
TransactionManager.Instance.EnsureInTransaction(doc)
OUT = Wire.Create(doc,wireTypeId,view,wiringType,vertexPts,sConnector,eConnector)
TransactionManager.Instance.TransactionTaskDone()
Thanks for your inputs