Hi Everyone,
I’m currently trying to learn DesignScript for pyRevit.
I’ve wrote the following code below, but i’m stuck on the line "DetailLine = doc.Create.NewDetailCurve(View, Line)"
I’ve tried a few different alternatives, but I can’t work out what i’m doing wrong here. Could someone able to point me in the right direction please.
“”""""""""""""""""""""""""""" #import libraries and reference the RevitAPI and RevitAPIUI
import clr
import math
clr.AddReference(‘RevitAPI’)
clr.AddReference(‘RevitAPIUI’)
from Autodesk.Revit.DB import *
doc = 'Detail Line - Continuous 0.18’ title = ‘CONT18’
#set the active Revit application and document
uidoc = revit.ActiveUIDocument
doc = revit.ActiveUIDocument.Document
app = revit.Application
view = doc.ActiveView
#define a transaction variable and describe the transaction
t = Transaction(doc, ‘Create Detail Line’)
t.Start() #perform some action here…
create two points:
p1 = uidoc.Selection.PickPoint(“Click to specify instance location.”)
p2 = uidoc.Selection.PickPoint(“Click to specify instance location.”)
Create Line:
Line = app.Create.NewLineBound(p1, p2)
DetailLine = doc.Create.NewDetailCurve(View, Line)
t.Commit()
"""""""""""""""""""""""""""""