Hi All
I am trying to create a radial dimension on a detail item in a view. I can’t seem to get the API method AngularDimension.Create to work. My Python code returns the error “references should be at least two, non parallel and rays of the arc passed” so I am most likely not inputting the circle references the correct way.
I tried following the tread at the link below.
Thanks for your help.
import clr
import System
clr.AddReference('ProtoGeometry')
import Autodesk.DesignScript.Geometry as DSGeo
from Autodesk.DesignScript.Geometry import *
#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument
app = uiapp.Application
sdkNumber = int(app.VersionNumber)
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
#INPUTS
circleCurve = UnwrapElement(IN[0])
dimType = UnwrapElement(IN[1])
point = UnwrapElement(IN[2])
#CODE
ref = Reference (circleCurve)
activeView = doc.ActiveView
arc = circleCurve.GeometryCurve
arcCenter = arc.Center
arcCenterRef = circleCurve.CenterPointReference
refs = [ref,arcCenterRef]
TransactionManager.Instance.EnsureInTransaction(doc)
AngularDimension.Create(doc,activeView,arc,refs,dimType)
TransactionManager.Instance.TransactionTaskDone()
OUT = arcCenterRef,refArray