Angular dimension node/code

Hi, I am looking for a node (or code) that can create an angular dimension between two lines. Does such a node exist? (in any of the custom packages maybe?)

I don’t think there is any node till now for angular dimension. But you could look into Revit API Docs

AngularDimension.ByElements.dyf (23.5 KB)

I found this one in clockwork package. though I couldn’t use it cause I cant find the input “dimension type”
if you could get it worked then please help me too.

I tried this one. it does work but only in floor plan views, not in elevation views

A bit janky but will do

import clr
import Autodesk
from Autodesk.Revit.DB import *

import System
from System.Collections.Generic import *
from System import Array

import DSCore
from DSCore import *
from Autodesk.DesignScript.Geometry import *

import Revit
from Revit.Elements import *

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

fec = FilteredElementCollector(doc).OfClass(View)
fec2 = FilteredElementCollector(doc).OfClass(Autodesk.Revit.DB.DimensionType)

elements = IN[0]
radius = IN[1]
d3 = []
dt = []

for i in fec:
	if "{3D}" in i.Name:

for i in fec2:
	if "Angular" in i.FamilyName:

def thereWillBeArc(e):
	lines = [UnwrapElement(i).GeometryCurve.ToProtoType() for i in e]
	normal = lines[0].NormalAtParameter(0.5)
	tangent = lines[1].TangentAtParameter(0.5)
	tangentI = tangent.Reverse()
	points = [i.PointAtParameter(0) for i in lines]
	points2 = [i.PointAtParameter(1) for i in lines]
	plane = Plane.ByOriginNormal(points[0], normal)
	cPoint1 = points[1].Project(plane,tangent)
	cPoint2 = points[1].Project(plane,tangentI)
	if len(cPoint1) == 0:
		cp = cPoint2
		cp = cPoint1
	v1 = Vector.ByTwoPoints(points[0],points2[0])
	v2 = Vector.ByTwoPoints(points[1],points2[1])
	a1 = Vector.AngleAboutAxis(v1,Vector.XAxis(),Vector.ZAxis())
	a2 = Vector.AngleAboutAxis(v2,Vector.XAxis(),Vector.ZAxis())
	return Arc.ByCenterPointRadiusAngle(cp[0],radius,a1,a2,Vector.ZAxis())

ar = thereWillBeArc(elements).ToRevitType()
lines = [UnwrapElement(i).GeometryCurve for i in elements]
ref = [lines[0].Reference, lines[1].Reference]
refs = Array[Reference](ref)


OUT = AngularDimension.Create(doc, doc.ActiveView, ar, refs, dt[0])


To make it work in vertical sections, you’ll need to feed appropriate vectors for the arc.

1 Like