Very simple question, but I do not know how to visualise in Dynamo. How to know where is the Origin Point of a Title Block and where is its geometry located from that point?
I do not know how far are the contour lines of the title block from that origin, as I cannot set up the origin in the title block family I belive.
Easiest way: Open the family and draw a line with a start point where you want the origin to be. Copy that line, and then in dynamo select the copy and move it by the inverse vector created by the start point of the line.
Simple non-program way is to make an X in AutoCAD at 0,0,0 and import that into your titleblock family origin-to-origin. X will mark 0,0. If I recall correctly, a lot of the Revit templates have the lower left off the 0,0 by some 256th of an inch. No idea why or if that is just ahold over from days gone by.
I’d start with Select model element, select a title block instance, and then uses Element.Geometry. If that fails, post it and we can discuss from there.
thanks, I do not want to create annotative elements in sheets, but would like to know where is the origin point of the sheet and where is a point of the title block to know where to place views over the title block placed on a sheet, so I need to specify coordinates that make no sense if not knowing this
not the easy way but what I was asking I resolved myself:
import clr
# Import RevitAPI Classes
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitNodes')
import Revit
# Import DocumentManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
clr.ImportExtensions(Revit.GeometryConversion)
if isinstance(IN[0], list) : sheets = UnwrapElement(IN[0])
else : sheets = [UnwrapElement(IN[0])]
titleBlock=[]
for sheet in sheets:
doc=sheet.Document
title=FilteredElementCollector(doc,sheet.Id).OfCategory(BuiltInCategory.OST_TitleBlocks).ToElements()
titleBlock.extend(title)
annotations=UnwrapElement(titleBlock)
if not hasattr(annotations, '__iter__'):
annotations = [annotations]
BBox = []
for anno in annotations:
viewId = anno.OwnerViewId
view = doc.GetElement(viewId)
BBox.append(anno.BoundingBox[view].ToProtoType())
#if isinstance(titleBlock, list): OUT = BBox
#else: OUT = BBox[0]
OUT = [XYZ(bbox.MinPoint.X,bbox.MinPoint.Y,bbox.MinPoint.Z) for bbox in BBox]
or this:
import clr
# Import RevitAPI Classes
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitNodes')
import Revit
# Import DocumentManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
clr.ImportExtensions(Revit.GeometryConversion)
sheets = UnwrapElement(IN[0]) if not isinstance(IN[0], list) else [UnwrapElement(e) for e in IN[0]]
OUT = [XYZ(bbox.MinPoint.X,bbox.MinPoint.Y,bbox.MinPoint.Z) for sheet in sheets for title in FilteredElementCollector(sheet.Document, sheet.Id).OfCategory(BuiltInCategory.OST_TitleBlocks).ToElements() for anno in [UnwrapElement(title)] if hasattr(anno, 'OwnerViewId') for bbox in [anno.BoundingBox[doc.GetElement(anno.OwnerViewId)].ToProtoType()]]