Author Topic: Ancillaries in Revit  (Read 1019 times)

0 Members and 1 Guest are viewing this topic.

Offline bitterfitterTopic starter

  • Senior Member
  • ****
  • Posts: 395
  • Country: us
  • Gender: Male
Ancillaries in Revit
« on: Dec 17, 2021, 14:03:07 PM »
I am back to working on getting my ancillaries functioning properly in Revit and think I may need some guidance.  I have a really good understanding of how these are setup and work in CADmep but I have a couple questions on how they function in Revit.  Not sure if there is anyone that may be able to help me through this?
for instance: once a hanger  (itm.) is modeled in Revit, I can highlight it and get the Default text at the top of the rod.  When I click on the default text I get a drop down of my ancillary kits, but I get all the kits for all the rod sizes.  Is there a way to just get the kits with the same rod diameter as the modeled hanger?  Like only 3/8" rod diameter kits for say a 2" line sized clevis hanger?
"If you think education is expensive, you should see what ignorance costs you"

Offline Darren Young

  • Premier Member
  • *****
  • Posts: 1968
  • Country: us
  • Gender: Male
    • BIM There Done That.
Re: Ancillaries in Revit
« Reply #1 on: Dec 23, 2021, 17:01:45 PM »
I don't think so. Ancillary Kits are how they allow you to override rod size so I'm not sure how you'd filter out alternate rod sizes.

Offline bitterfitterTopic starter

  • Senior Member
  • ****
  • Posts: 395
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #2 on: Dec 27, 2021, 18:21:09 PM »
Let  me ask this then; once the support is modeled, does the support store any data as far as what it is attached to?  So if I model a hanger and it snaps to the deck above because it is structure, then the hanger recognized the structure above in order to snap to it.  And if I was to model a piece of Unistrut above the hanger rod then I can click on the hanger and it will shorten the rod and attach to the Unistrut as it recognizes it as structure also.  If I could access this data inside the hanger then I could filter, sort, and assign the correct ancillaries fairly easily.  Almost like using the old "structure types".  This would all just seem to hinge on pulling the structure data from the hanger.  Any thoughts if this is even possible?
"If you think education is expensive, you should see what ignorance costs you"

Offline bitterfitterTopic starter

  • Senior Member
  • ****
  • Posts: 395
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #3 on: Dec 27, 2021, 18:41:02 PM »
I don't think so. Ancillary Kits are how they allow you to override rod size so I'm not sure how you'd filter out alternate rod sizes.

I was hoping by using the breakpoints highlighted below in the ancillary kit that I could build one common kit that would breakout the appropriate rod diameter pieces based on the hanger rod size.  So for side beam clamps, using the breakpoints in the kit I would include the correct sized pieces based on the pipe size I am hanging.  Automatically of course... ;D
« Last Edit: Dec 27, 2021, 18:43:07 PM by bitterfitter »
"If you think education is expensive, you should see what ignorance costs you"

Offline Axl

  • Full Member
  • ***
  • Posts: 93
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #4 on: Dec 28, 2021, 13:04:51 PM »
It is possible to access the data, but it is not easy, you need some Dynamo knowledge, python (or C#) and some other tools like the Revit Lookup to find and pull what you need. We spool hangers based on those tools but it requires to change the way your spooling team works and also dedication to the scripts, because like everything else in Autodesk is very buggy and requires constant fix
CADmep DB Manager
Content Manager
Scripting

Offline bitterfitterTopic starter

  • Senior Member
  • ****
  • Posts: 395
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #5 on: Dec 28, 2021, 14:35:27 PM »
Axl - I hear you there with the buggyness and constant attention needed.  Just knowing this info is stored in the support is all I need to know.  I can take it from there to extract the info and use it.  Just being fairly new to Revit , I am still unsure of just what I can actually pull from the items.  thanks for the insight.  I will fire up Dynamo and see what kind of trouble I can get into...   ;D
Any chance someone knows off hand which data line contains the info on the structure the support is attached to?
« Last Edit: Dec 28, 2021, 14:49:51 PM by bitterfitter »
"If you think education is expensive, you should see what ignorance costs you"

Offline Axl

  • Full Member
  • ***
  • Posts: 93
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #6 on: Jan 03, 2022, 18:32:18 PM »
There is very few people working on this, it took me months to get to the point of having a usable product, but I'm 100% willing to share with this forum that has helped me so much in the past,

first try this link,
https://www.revitapidocs.com/2022/d1b925eb-9fde-0c61-e416-25b4e98a8fd4.htm

the query will return an object with multiple "lines" of information, the way I do it is to loop through it and get all values, there is also Get rod length, position, attached and end position (for trimble information) search for Get Rod in the link to get more information.

The following are Python nodes that I've created to extract some of the Rod's related information, feel free to use it and change it according to your needs, you need to build a lot around them but those will be only simple existing blocks, the hard part is to get these python scripts working correctly.

Remember these are very customized scripts and you will see some things that probably you won't need

Code sample to extract coordinates:
Code: [Select]
import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import FabricationPart
from Autodesk.Revit.DB import FabricationRodInfo

Inpt = UnwrapElement(IN[0])
List = []
count =IN[1]
ItmList = list()
ItmList1 = list()
ItmList2 = list()
coor_list = list()
new_list = list()
neo_list = list()
if count == 1:
List.append(Inpt)
for e in List:
STName = e.GetRodInfo().RodCount
ItmList1.append(STName)
STName1 = e.GetRodInfo()
for n in range(STName):
test = STName1.GetRodLength(n)
test1 = STName1.GetRodEndPosition(n)
ItmList.append(test)
ItmList2.append(test1)
coo_pnt = str(test1).split(",")
coor_list.append(coo_pnt)
str_coor = ''
if count > 1:
for e in Inpt:
STName = e.GetRodInfo().RodCount
ItmList1.append(STName)
STName1 = e.GetRodInfo()
for n in range(STName):
test = STName1.GetRodLength(n)
test1 = STName1.GetRodEndPosition(n)
ItmList.append(test)
ItmList2.append(test1)
coo_pnt = str(test1).split(",")#.replace("(","").replace(")","")
for c in coo_pnt:
cc = c.replace("(","").replace(")","")
ccc = round(float(cc),2)
coor_list.append(ccc)
str_coor += str(ccc)+','
str_coor2 = '('+str_coor+')'
new_list.append(str_coor2)
str_coor = ''
str_coor2 = ''
coor_list = list()


OUT = ItmList, ItmList1, ItmList2, new_list


Code sample to get Rod Count:

Code: [Select]
import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import FabricationPart
from Autodesk.Revit.DB import FabricationRodInfo

Inpt = UnwrapElement(IN[0])
rcnt = list()
count = len(Inpt)

if count == 1:
List.append(Inpt)
for e in List:
STName = e.GetRodInfo().RodCount
rcnt.append(STName)
if count > 1:
for e in Inpt:
STName = e.GetRodInfo().RodCount
rcnt.append(STName)

OUT = rcnt

Code Sample to get Rod Diameter:

Code: [Select]
import clr
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import System
from System import Array

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

clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import FabricationPart
from Autodesk.Revit.DB import FabricationAncillaryUsage
from Autodesk.Revit.DB.Fabrication import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
from Revit import Elements

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from System.Collections.Generic import *

Inpt = UnwrapElement(IN[0])
Cnt = len(Inpt)
AnciCnt = list()
AnciObj = list()
AnciID = list()
AnciDiam = list()
AnciType = list()
AnciDepth = list()
AnciValid = list()
AnciLngth = list()
AnciProdCde = list()
AnciQty = list()
AnciUseTyp = list()
diamlist = list()
hgrlist = list()

clr.ImportExtensions(Revit.GeometryConversion)

Doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
TransactionManager.Instance.EnsureInTransaction(Doc)
cntr = 1
paramslist = list()
if Cnt > 1:
for e in Inpt:
AnciObj = e.GetPartAncillaryUsage()
AnciCnt.append(len(AnciObj))
diamlist.append(e)
#diamlist.append(cntr)
hgrName = e.ProductShortDescription
hgrlist.append(hgrName)
if "CT-69" in hgrName:
vv = '0.03125'
AnciDiam.append(vv)
for n in AnciObj:
AnciID.append(n.AncillaryId)
AnciType.append(n.Type)
vv = n.AncillaryWidthOrDiameter
tt = str(n.Type)
#AnciDiam.append(vv)
# if vv != 0:
# AnciDiam.append(vv)
if tt == "SupportRod":
AnciDiam.append(vv)
#AnciDiam.append(cntr)
# AnciDiam.append(tt)
cntr = cntr + 1
else:
part = Inpt[0]
AnciObj = part.GetPartAncillaryUsage()
AnciCnt.append(len(AnciObj))
for n in AnciObj:
AnciID.append(n.AncillaryId)
vv = n.AncillaryWidthOrDiameter
tt = str(n.Type)
#AnciDiam.append(vv)
# if vv != 0:
# AnciDiam.append(vv)
if tt == "SupportRod":
AnciDiam.append(vv)
# AnciDiam.append(tt)


TransactionManager.Instance.TransactionTaskDone()

OUT = AnciDiam
CADmep DB Manager
Content Manager
Scripting