And may be anybody explain how correctly use FamilyItemFactory Class
because of for example we cant use : dimension =doc.Create.NewArcLengthDimension(doc.ActiveView, arc, arc_ref, refs)
its - not a ItemFactoryBase Class
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
from Revit.Elements import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
arc=UnwrapElement(IN[0]).GeometryCurve
arc_ref=arc.Reference
ref1=UnwrapElement(arc).GetEndPointReference(0)
ref2=UnwrapElement(arc).GetEndPointReference(1)
TransactionManager.Instance.EnsureInTransaction(doc)
dimension = doc.FamilyCreate.NewArcLengthDimension(doc.ActiveView, arc, arc_ref, ref1, ref2)
TransactionManager.Instance.TransactionTaskDone()
OUT =arc, arc_ref, dimension
This seems to work for me in a family. But I think the method is not available in the project environment.
I get:
"Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 29, in
AttributeError: ‘Document’ object has no attribute ‘NewArcLengthDimension’ "