Bounding Box of Tag

Yeah, I thought about it a bit and it seems like you can use the following method to find where the tag resides in the model.

Here is the python for it:

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# Import ToDSType(bool) extension method
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

from System.Collections.Generic import *

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk


#unwrap all elements to use with API
tags = UnwrapElement(IN[0])
#apply lineweight override to elements in an input list
tagHeadPosition = list()
for i in tags:
	try:
		tagHeadPosition.append(i.TagHeadPosition.ToPoint())
	except:
		tagHeadPosition.append(list())


#Assign your output to the OUT variable
OUT = tagHeadPosition

This could prove to not work on door tags “inside” the wall though.

That being said, I bet you could make a custom bounding box and intersect them against your rooms or something.

So this graph:


20180220-tagsIntersectingRoom.dyn (25.0 KB)

Would result in this.

Since I did not know the filtering you were using, I just filtered rooms out that started with “12” in the number.

-john

5 Likes