Author Topic: Ancillaries in Revit  (Read 7691 times)

0 Members and 2 Guests are viewing this topic.

Offline bitterfitterTopic starter

  • Senior Member
  • ****
  • Posts: 451
  • 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: 2081
  • 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: 451
  • 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: 451
  • 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: 169
  • 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: 451
  • 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: 169
  • 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

Offline bitterfitterTopic starter

  • Senior Member
  • ****
  • Posts: 451
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #7 on: Jul 20, 2022, 20:26:50 PM »
Axl - Thanks for the reference material on writing with Python.  I does help a lot.  I did have a quick question about when you are pulling the rod diameters with your code.  I see how you are doing it but I noticed one thing I get in my data that drives me nuts and I am not just yet to the point of altering your code.  If I run 14 hangers through your script, but 2 do not have a value for the rod diameter; like if I am using hanger strap, then the script only reports 12 diameters.  Worst part is that the rod diameters no longer line up with the hanger element they are pulled from.  I have tried working with this after the script with nodes, but it appears I should be matching them up in the script itself.  Is this something that is possible in Python.  To hold the diameters to the elements they are pulled from?  maybe by placing a zero in for the missing data?
"If you think education is expensive, you should see what ignorance costs you"

Offline Axl

  • Full Member
  • ***
  • Posts: 169
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #8 on: Jul 20, 2022, 22:04:41 PM »
Indeed it is possible,

possible root cause: the rod information is missing on those hangers, or the hangers have no rods, I usually filter those hangers out by either code or Revit filters,

try this code, the only difference is that check if vv value is empty and make it a zero, I have not tested it, good luck :)

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 == None:
                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

Offline bitterfitterTopic starter

  • Senior Member
  • ****
  • Posts: 451
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #9 on: Jul 22, 2022, 19:57:24 PM »
Axl - Thanks for the revised code.  Now that I see what you did there it seems extremely easy. I have a feeling I will use that a lot more to come. 
It seems I have a deeper problem that I have worked on for a couple days now and I have not been able to find the issue.  It is only affecting half strap hangers for duct.  I have them setup correctly with the support specs and ancillaries. No matter what I choose for the ancillary or if I even leave the hanger as Default, I still get no ancillary parts reporting for these hangers.  The only item I see is sealant which is being pulled from the duct specification.  Every other pipe and duct hanger works as it should.  I have no ideas left as to where to look.  Can some check their half strap hangers and let me know if they work so I know that is something I have wrong and not a bug? >:(
"If you think education is expensive, you should see what ignorance costs you"

Offline DotNet

  • Senior Member
  • ****
  • Posts: 302
  • Country: us
  • Gender: Male
    • MICLOGIC
Re: Ancillaries in Revit
« Reply #10 on: Jul 22, 2022, 20:33:15 PM »
The HangerRodKit property does change however the ancillaries do not. I can confirm ancillary kits do not appear to be working correctly with CID#838 when the type option is set to Z-Strap, even in CADmep.

Offline bitterfitterTopic starter

  • Senior Member
  • ****
  • Posts: 451
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #11 on: Jul 25, 2022, 13:03:38 PM »
Thanks for the info DotNet.  So I am not crazy that the Z-strap doesn't work properly. And I thought I was doing something wrong.  So I will have to look into the HangerRodKit properties will give me what I am looking for.  Thanks again
"If you think education is expensive, you should see what ignorance costs you"

Offline bitterfitterTopic starter

  • Senior Member
  • ****
  • Posts: 451
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #12 on: Jul 25, 2022, 13:15:42 PM »
The HangerRodKit property does change however the ancillaries do not. I can confirm ancillary kits do not appear to be working correctly with CID#838 when the type option is set to Z-Strap, even in CADmep.

Do you know if the CID#1250 pattern for the Z Strap is working correctly?  I could switch over but I thought the last I knew, the newer 12XX hanger CID's were not working right either.
"If you think education is expensive, you should see what ignorance costs you"

Offline Axl

  • Full Member
  • ***
  • Posts: 169
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #13 on: Jul 25, 2022, 22:20:59 PM »
In that case I would suggest you read the name of the hanger and if you find a half strap (or anything failing for that matter) create a preset table based on the size that can add manually the ancillaries in your table.

Something like:

hlf_strp_anc = [[0.5,'anc1','anc2','anc3],[0.75,'anc1','anc2','anc3].....]
CADmep DB Manager
Content Manager
Scripting

Offline bitterfitterTopic starter

  • Senior Member
  • ****
  • Posts: 451
  • Country: us
  • Gender: Male
Re: Ancillaries in Revit
« Reply #14 on: Jul 26, 2022, 11:57:33 AM »
I like your thinking Axl but that might still be beyond my capabilities.  I noticed that the HangerRodKit number is unique to each ancillary kit.  I thought about reading this number and assigning each its kit name.  Then I can report what top fixing would be for each hanger.  I may still have to use your idea to get all the parts and pieces for an ancillary BOM...
"If you think education is expensive, you should see what ignorance costs you"