Need to able to include a second element geometry to the code that has no centerline

Hello!
I’m new to Dynamo and this forum but with enough time can understand logic of it. I want to modify a script to be able to include a second element geometry to use it as pathing direction for conduits.

As of now, script works like this:

  1. Select two objects (Electrical Fixture) that has distance between. (this is done in the model)
  2. Select conduit type.(this is done in the model)
  3. Run
  4. Select pathing (only cabletrays)
  5. Esc
    And done. When cable is placed, it gets som parametres from cabletrays and objects (Electrical Fixture). That cable will follow pathing created by cabletrays. It will stay connected and it will follow all slopes and curves. It will also draw cable to the objects (Electrical Fixture) geometry center.

Script is done in this specific manner to be able to place a “connected” cable trough the pathing that is created by the cabletrays. Cabletrays are allways straight but create slopes and curves by placing them at different angle to each other. (Sorry for bad english, I dont know how else to put it)

My question is: Is it possible to modify this script in such manner, that it will allow for selection of a different element (Mechanical Equipment)? In my case this element has no centerline and only 1 defineble parameter that is length. In the model, this element positions is already predefined and there are hundreds of them. I want to be able to automate cabledrawing even using this elements (Mechanical Equipment) geometry. These elements don’t generate points (null in Watch node top-right corner of screenshot)

This is what I have so far:

This script isn’t mine, it is from my colleague. He says what I ask is impossible but I want to belive otherwise, hence I’m here asking for advice.
I’ve noticed that Dynamo doesn’t export node names so I tried to cramp up the script and hope it is visible.

These packages are being used:
GenerativeDesign, GeniusLoci, MEPover, Springs, Synthesize, SynthesizeUnfold.

I want to belive that this is possible! What do you think?

Welcome @dmytro.baka
Not sure I can help with your issue, but it may help others if you could show what is being returned by the three nodes that are circled in red and also provide what the two errors are circled in blue.

If you don’t know how to show the node results, hover your mouse over the word “Auto” in the bottom right corner and when the dropdown shows up move your mouse down to when you see the little push-pin and click that. That will lock the results list open.

image

Thank you for your response @staylor
I appriciate it a lot!

Here comes more info:

Returns screenshot:

Both errors:
Warning: Asked to convert non-convertible types

I’ve had an idea but I’m not sure how to follow up on it. In “returns” you can see that cabletrays give lines while “klamringsband_passage” gives points. If there is a way to read and create a line between start and end points of this object or read klamriungsband object geometry into as a line somehow so it would count as a cabletray, it cound be a fix to this script.

Otherwise this script, while there are no “klammringsband” works like magic.

Another idea I’ve had is to maybe edit klammringsband family so it would have a line start and endpoints. But I have no idea how changing this would affect the entire model.

I’m assuming those are something like fittings that return just points? If you don’t care about the exact geometry you can get the connector points of all your elements and draw lines between the connectors. That will give you cabletray curves and approximated fitting curves.

The errors are because you are feeding a point into a node that only looks at curves (lines), so you are on the right track as far as taking care of the errors.

From what you specified in your original post, item #4 is selecting cabletrays only. But in your list you have both cabletrays and klameringsband_passage selected. So curious if this part of the selection was done correctly. Not knowing how your cabletray and klameringsband_passage families are created, can’t really give you any guidance on how to modify the klameringsbands to get a line to return instead of a point. If you want to attach those two families to this thread, that may help clarify.

Honestly, I have no clue what a klameringsband_passage is, so just shooting from the hip with my responses.

Thank you for your time @staylor and @Nick_Boyts. You were both spot on with your answers and I see the issue. After long debate here at home we agreed that it would be easier to adjust this family to contain other points and a centerline to make it easier on everyone.
Awesome! Thank you again!

Have a nice one!

1 Like