Python Insert Dynamic Block Reference function

Im wanting to replace the “BlockReference.ByCoordinateSystem” node with a python function. Long story short, I have a script that requires a little input, then a python script figures out where dynamic blocks need to be placed in modelspace, then i pass that to a BlockReference.ByCoordinateSystem node, then with another python script insert the dynamic block reference values. I want to replace this all with a single python script as im having some pretty big issues with element binding and my understanding is if information isnt passed between a bunch of nodes, there is less or no issues with element binding. Can anyone help? Thank you!!

This isn’t the case, but if you need to suppress bindings you can use a Function.Apply node to suppress them entirely. I have not tested with all versions of Dynamo for Civil 3D though so check closely and carefully.

See answer here:

Using a Python node is not going to circumvent the bindings unless you run through Dynamo Player. Like Jacob said, you could also use a Function Apply node in combination with Dynamo Player to achieve the same result.

Can you explain further? I’ve read through your element binding explanation and still not sure I understand.

Essentially I have a script that takes bunch of inputs, runs a large python graph to figure out placement of various blocks, pastes those blocks in civil3D, then uses the objectIDs to link those blockrefs to other blockrefs through dynamic attributes. The script takes about ~30 seconds to run but with every run takes significantly longer. Bindings are deffinitely the issue. Is there a way to turn them entirely off? For my purposes, we never need bindings of any kind.

Utilize the Function.Apply node shown by @mzjensen above, and leverage Dynamo Player for each of the runs and you should be fine. If you’re having a hard time applying this method to your current graph you’ll have to provide a sample so we can show you how to utilize the node correctly.

I think i understand the application of it, what i was more curious of is why that node helps eliminate element binding? Am i understanding that use of that node(on outputted elements) has to be used in conjunction with the player in order to totally eliminate binding?

In most Dynamo instances binding is stored in specific nodes which create the objects in the host environment. These are owned by the integration, not core Dynamo. Since Function.Apply is a part of core Dynamo and each integration needs it’s own binding method, there is no way for the traditional binding to occur.

However, Civil 3D is unique in that is has multiple binding mechanisms at play. Not only is data saved into the DYN but it is also stored in the DWG. As such to completely circumvent bindings in Civil 3D will require some extra steps like this, and thorough testing because each release has a different set of mechanisms in play.