XtraCAD.com

Fabrication in Revit® => Dynamo for Autodesk┬« Revit => Topic started by: bitterfitter on Jan 31, 2022, 16:55:19 PM

Title: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Jan 31, 2022, 16:55:19 PM
I am looking to extract my hanger ancillaries using Dynamo.  I notice when I use the Snoop add-In on my hanger, I get a list of what looks to be many hidden parameters. See attachment 1

If I expand the "Get Part Ancillary Usage" line, I get the list shown in attachment 2

This looks promising as it references all the pieces that are in the set ancillary to that chosen hanger.  Any ideas on how I can access this list through Dynamo? I am thinking:
choose hanger elements
look for the parameter named " Get Part Ancillary Usage"
List these parameters
write each parameter to a new set of Shared parameters that I can then write in a schedule???
Title: Re: Help accessing hanger ancillary info in Revit
Post by: acad2015 on Jan 31, 2022, 19:19:21 PM
I cobbled something together quickly to get you started. You should be able to build off of it to make it your own. If I have more time later on, I will try to supply you with a more finished product, but don't hold your breath. Haha.
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Jan 31, 2022, 19:40:17 PM
Thanks for the head start!  I am going to see what kinda trouble I can get into with it... ;D  I will make sure to post any progress I make to help out the next guy.
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Feb 01, 2022, 14:40:58 PM
acad2015 - I started working with the custom node but I am encountering a naming error in line 38. I tried a few things but I could not seem to get it to work properly.  Any chance that you could just see if it is something basic I am just overlooking?  Other than that everything is working good....
Title: Re: Help accessing hanger ancillary info in Revit
Post by: acad2015 on Feb 01, 2022, 14:56:16 PM
Here you go. I fixed it. This will get you the Ancillary Ids. It's not very useful as it is, but hopefully it will shed some light on how to access that data.
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Feb 01, 2022, 15:02:07 PM
Thank you.  I really hated to ask for your help again after you took the time to post the node in the first place.
Title: Re: Help accessing hanger ancillary info in Revit
Post by: acad2015 on Feb 01, 2022, 15:21:11 PM
Thank you.  I really hated to ask for your help again after you took the time to post the node in the first place.

Don't worry about that. If I have time to help, I will.
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Feb 01, 2022, 15:59:25 PM
acad2015 - I think I broke it already..  ;D

I seem to be getting an error in line 35 - I may take a break and come back to this.  Starting to see double already LOL
Title: Re: Help accessing hanger ancillary info in Revit
Post by: acad2015 on Feb 01, 2022, 16:03:12 PM
Haha. Ok. I'll try and find time to make a working version.
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Feb 01, 2022, 16:26:24 PM
Here is a little info that might help.  I ran the node the first time and it generated the list of AncillaryIds as expected.  When I tried running it again, I started getting the error in line 35.  I even tried running the original node you posted and now I get an error at line 35 on that one also.  I am starting to think I may have broken something good.. :(
Title: Re: Help accessing hanger ancillary info in Revit
Post by: Axl on Feb 01, 2022, 19:27:40 PM
Sometimes, when you get critical issues with Dynamo the virtual machine (created by Dynamo) gets corrupted or damaged, close the script completely and try again, sometimes even requires to reload the view or Revit.
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Feb 02, 2022, 13:53:48 PM
I have tried reloading the script, shutting down Revit and restarting and even tried a different project.  Same error coming up.  see attachment
Title: Re: Help accessing hanger ancillary info in Revit
Post by: acad2015 on Feb 02, 2022, 14:08:09 PM
Try having 2 items selected. I do not think I put in the necessary code to run on only one item. I truly did that way to quick and probably sent you down a rabbit hole with hardly anything to go on now that I look back at it.
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Feb 02, 2022, 14:28:14 PM
You are a genius!  I tried it on three hangers and voila!!  worked as expected.  I can't believe I didn't catch this.  Sorry for taking up some much of your time. :-[
Can I just run one thing past you?  So to list the "Type" under FabricationAncillaryUsage, can I just simply replace "AncillaryId" with "Type"?
Title: Re: Help accessing hanger ancillary info in Revit
Post by: acad2015 on Feb 02, 2022, 14:50:31 PM
Replace the one I circled with "Type".
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Feb 02, 2022, 19:55:10 PM
acad2015 - Just to report back.  Thanks again for the help.  i have moved along to gather and place all the ancillary properties into shared parameters which I set.  Everything is working well.  Now I have to brush up on my Python, as I believe this is where I need to look next.  Since every element (hanger) can have a different number of ancillaries, I think I want them to output from the code block in two lists, grouped by element.  So hanger 1 --> ancillary list 1, Hanger 2 --> ancillary list 2, and so on.  then I should be able to just report by index from the ancillaries per hanger.  Again, thanks for the huge push in the right direction  :)
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Feb 04, 2022, 13:18:41 PM
So I tried taking acad2015's code and adding a sub list to get the Ancillary Ids per element but I am getting an error. Can anyone see where I am going wrong here?
Title: Re: Help accessing hanger ancillary info in Revit
Post by: Axl on Feb 04, 2022, 15:19:36 PM
Change    Ancillaries = []
for          Ancillaries = list()
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Feb 04, 2022, 16:13:18 PM
Thanks Axl.  That did it for sure...  So now we have reported one of the 6 pieces of data I need from each ancillary. I am thinking now I have to replicate the script, altering for each of the 6 pieces of data I need.  then a massive sort/group to get all the data into the correct shared parameter. :)
Thanks again to acad2015 and Axl for all the help so far.  I will make sure to post the final script/node when completed.
Title: Re: Help accessing hanger ancillary info in Revit
Post by: bitterfitter on Apr 26, 2022, 17:56:20 PM
Not to beat this ancillary thing to death, but is there a way I can pull the ancillary kit name instead of the actual pieces in the kit?  By ancillary kit name I mean the name of the kit I choose in the drop down at the top of the hanger rod where it comes in as Default?