Author Topic: New Dynamo Nodes for Fabrication & Example Script  (Read 573 times)

0 Members and 1 Guest are viewing this topic.

Offline biorpgTopic starter

  • Active Member
  • **
  • Posts: 8
  • Country: us
  • Gender: Male
New Dynamo Nodes for Fabrication & Example Script
« on: Apr 08, 2018, 08:06:36 PM »
I've just published a couple of new nodes in a package called "Fabrication API". You can find it in your Dynamo package manager. Big thanks to Nathan Chapman for his DynaFabrication packages, as they provided a great starting point.

Included so far are two nodes:
The first node, "Fabrication Part Dimensions", will return an array of dimensions from FabricationPart(s). This array includes dimension names (Width, Diameter, Inner Radius, Bottom Extension, etc.), dimension values (in feet for linear dimensions and in radians for angular dimensions), as well as the UnitType of the dimension (Linear, Angular) so that you can correctly convert the dimension to inches or degrees, if need be.

The second node, "SetDimensionValue", will modify the value of a FabricationPart dimension given the zero-based index of the dimension to modify (For CID#2, the index of "Width In" is 0, the index of "Depth In" is 1), and the new value in feet or radians.

I've attached a Dynamo script that makes use of both nodes. It doesn't have much practical use, but it does provide an example of how to work with FabricationPart dimensions utilizing the two nodes.

When you run the script, you will be presented with a dialog containing a drop-down list of all the CIDs currently in use. When you select one, you'll be presented with a list of all FabricationParts of that CID, from which you can select specific parts to modify. Then you will see a drop-down list containing the names of all the part's dimensions. After selecting which dimension to modify, you get an edit box to enter the new value into. After clicking the button, the change will be made to each part you checked in the list. Afterward, depending on what you modified, Revit will likely present you with the option to disconnect parts with now invalid connection points, or to delete parts with now invalid dimensions. Thankfully though, when adjusting things like elbow extensions, Revit is smart about it and automatically adjusts the length of connected pieces.

http://i.imgur.com/ME6g2o3.png

This example script depends on the following Dynamo packages:
Fabrication API
DynaFabrication2018
Data-Shapes
Clockwork for Dynamo 1.x
spring nodes
Bakery

Offline Darren Young

  • Premier Member
  • *****
  • Posts: 1355
  • Country: us
  • Gender: Male
    • Hermancon Company LLP
Re: New Dynamo Nodes for Fabrication & Example Script
« Reply #1 on: Apr 09, 2018, 02:50:24 PM »
Nice. Thanks for sharing.

Offline acad2015

  • Active Member
  • **
  • Posts: 49
  • Country: us
  • Gender: Male
Re: New Dynamo Nodes for Fabrication & Example Script
« Reply #2 on: Apr 09, 2018, 04:35:19 PM »
Pretty slick. I like it. It will help me with a few reporting short comings I've had with Revit.

Offline digans

  • Active Member
  • **
  • Posts: 30
  • Country: us
  • Gender: Male
Re: New Dynamo Nodes for Fabrication & Example Script
« Reply #3 on: Apr 12, 2018, 04:23:39 PM »
Can I get some help using it? I don't know if there is a limitation in the CIDs you can use it on, or if I'm doing something really stupid here. I'm trying to modify a hanger in this example.


Offline acad2015

  • Active Member
  • **
  • Posts: 49
  • Country: us
  • Gender: Male
Re: New Dynamo Nodes for Fabrication & Example Script
« Reply #4 on: Apr 12, 2018, 04:34:02 PM »
Try adding a flatten list node between the select model elements node and the set dimension node.

Offline digans

  • Active Member
  • **
  • Posts: 30
  • Country: us
  • Gender: Male
Re: New Dynamo Nodes for Fabrication & Example Script
« Reply #5 on: Apr 12, 2018, 04:42:10 PM »
Nothing happened
Quote
Try adding a flatten list node between the select model elements node and the set dimension node.
« Last Edit: Apr 12, 2018, 04:43:42 PM by digans »

Offline acad2015

  • Active Member
  • **
  • Posts: 49
  • Country: us
  • Gender: Male
Re: New Dynamo Nodes for Fabrication & Example Script
« Reply #6 on: Apr 12, 2018, 07:00:21 PM »
After messing around with it, I got the following warning. Unless someone else can help, I believe you will not be able to adjust the rod length this way.

The hanger is hosted to the pipe or duct. This constrains it to where you cannot edit the rod length. If you copy the hanger or move it off of the pipe, it will disconnect from the host and is then able to be adjusted. However, then the hanger will not move with the pipe or duct if it is adjusted later on.
« Last Edit: Apr 12, 2018, 07:28:35 PM by acad2015 »

Offline digans

  • Active Member
  • **
  • Posts: 30
  • Country: us
  • Gender: Male
Re: New Dynamo Nodes for Fabrication & Example Script
« Reply #7 on: Apr 12, 2018, 08:17:02 PM »
That makes sense. I'll try to play with unconstrained items.
Thanks a lot

Offline biorpgTopic starter

  • Active Member
  • **
  • Posts: 8
  • Country: us
  • Gender: Male
Re: New Dynamo Nodes for Fabrication & Example Script
« Reply #8 on: Apr 12, 2018, 09:07:17 PM »
Might be able to do it with Python using the DisconnectFromHost method before changing rod length, and the PlaceOnHost method afterward.

Edit: Actually, looking at the FabricationRodInfo class, it looks like SetRodLockedWithHost(<rodIndex>,false) is what you need.

Edit: After a little test, IsRodLockedWithHost returns true for both rods of a bearer hanger by default. After running SetRodLockedWithHost on both rods, IsRodLockedWithHost returns false. However, I observe no change in the hanger's behavior. I also can't change Rod Length even after disconnecting the hanger. I have a feeling SetRodEndPosition will behave similar to dragging the nodes on the rods, but haven't tested.

Another idea might be to create a temporary structure element through Dynamo, and then run AttachToStructure on the hanger.
« Last Edit: Apr 12, 2018, 10:20:26 PM by biorpg »

Offline biorpgTopic starter

  • Active Member
  • **
  • Posts: 8
  • Country: us
  • Gender: Male
Re: New Dynamo Nodes for Fabrication & Example Script
« Reply #9 on: Apr 13, 2018, 04:24:50 AM »
I've added the node "AttachToStructure" to the Fabrication API package.
Also, here's a script I was fiddling with to try and create a floor above the hangers. It doesn't work yet, it has a problem extruding the floors.

Offline biorpgTopic starter

  • Active Member
  • **
  • Posts: 8
  • Country: us
  • Gender: Male
Re: New Dynamo Nodes for Fabrication & Example Script
« Reply #10 on: Apr 15, 2018, 03:27:05 AM »
I've added the node "FabricationPart.IsSameAs" to the "Fabrication API" Dynamo package.

The node accepts a list of FabricationParts to compare, and an optional list of "ignoreFields", a term that many of you may recognize from the RENUMBER command in Fabrication CADmep.  *hint hint* ;)

I've attached a very basic example of how to utilize the new node.
I have a much more complete script at work, but it was made on company time. Also, releasing it here for free would disrupt the sales of a very reasonably priced add-in distributed by contributing members of this community.