Problem accessing FabricationAncillaryUsage Class

Hi all. I’m having trouble calling a class from the API. I’m trying to access the ancillary data from fabrication parts, but I can’t seem to access the data with python/dynamo. I’m fairly sure it is something wrong with my code, I’ve been trying to figure out what is out of order but I’ve been staring at it all day and its starting to feel like I’m just spinning my wheels making no progress.

I was hoping somebody with more experience can take a look at what I have here and see if there is any obvious errors. These are the methods/classes I’m trying to access from the API documents. Primarily going after the “AncillaryWidthOrDiameter” property, but I’d like the “AncillaryId” and “UsageType” too as you can see by what I’ve written so far.

Any help is appreciated.

Get Ancillary (1.2 KB)

I uploaded an old version in my original post. Here is the one I meant to post as well as a screenshot of it for easier reading.

Get Ancillary (1.1 KB)

if I correct the typo and change UnitType to UsageType it works…? What error are you getting?

Yea, I caught the typo slightly after posting but ended up getting just a list of the ancillary kits available to each part and not the actual data from each kit. I had to define AnciObj as a list and then append the properties within to get the list of lists that I needed.

Could you post what your code is returning and an example of what you are expecting? I don’t think many people here have worked with Fabrication parts (I sure never did…!)
Or did you just solve your issue?

Sure! I did fix my issue here but I’ll show what happened for future reference.

The end goal of this particular node is to retrieve ancillary information built into fabrication parts. They ancillary kits contain information about fabrication parts that are not readily available as properties in Revit, so they must be accessed with the API. The first image shows the data I’m after using the snooping tool, any fabrication part can have 1 or more ancillary usages, the particular hanger rod I have selected has 3 for instance. For fabrication hangers in particular I’m looking for the AncillaryWidthOrDiameter of usage [0] which is the diameter of the support rod. When I’m done I’ll have a dynamo script that exports a .CSV with the hanger type, rod size, and rod endpoint location for all hangers on a job. That can then feed to our Trimble machine and be used to layout points.

Once I fixed the typo all I was getting was a list of the last selected parts number of ancillary usages. Once I changed it to match my last screenshot above and defined AnciObj as a list I got an output like the one in the second capture below, a list of lists showing the ancillary type IDs, sizes, and ID names that I can now use/filter how I need.

1 Like

@L-Vettz I am trying to make this work and I have the python you have copied but when it runs it just gives me 3 empty list, would you mind sharing the .dyn?

I have lots of .dyns that I use this node in now. Here is a snip of the .dyf. Once the code is run all it does is export the outputs from the python as output connectors to the node. Do the fab parts you are trying to read actually have ancillary data. Usually that’s optional data. Many databases wont use ancillary data to govern things like hanger rods.


Thanks! i am not entirely sure what i was doing wrong but I was able to get this working.