Giving Conduit Fittings their Space (name) as a Parameter

Hello, i tryed all day to set up a script, that gives my Conduit Fittings the name of the spaces they are in.

I made it this far:

But the end of the scipt does not work i did not find any solution while browsing this forum.

So i have 21 Spaces an each has some Conduit Fittings in it.
I took the Points of the Conduit Fittings and asked them, if they are in the spaces.
And i wanted to write the names of the Spaces in the Parameter “THN_A_FeldNr”, so that every fitting gets the right entry.

I hope you understand my problem and someone can help me with it.

Best regards
Florian

You’re pretty close. Just a couple things to work out:

  1. You can’t just update the value inside Dynamo, you need to write the new parameter value back to the respective element. Use Element.SetParameterByName to do this.
    1A. Using Parameter.ParameterByName returns the actual parameter object. You need to provide the parameter name (the string) when writing back to the element.
  2. Your current list levels for Space.IsPointInsideSpace and indexing to write the space number back to the element is a valid option, but may be more confusing than inverting your workflow. Right now you’re ending up with empty lists for spaces with no fittings. If you use @L1 for point instead of space, you can then filter the list of space numbers to get the one matching each fitting.
  3. Not really sure what you’re doing with List.Permutations and List.Flatten. You end up with the exact same list you started with. You can just use the list of numbers from Space.Number.

Hey Nick,
thanks for your answer, i ll try to figure out how to do what you discribed.
The first point was clear, i just wasnt done with the list. but all the stuff with the listlevels, i m realy stuggling with.
the notes with flatten and stuff, i was trying out if the lists would react better with each other that way. i have a lot to learn

another way, could probably be -get the fittings location, maybe translate that point - z so you are sure they hit a space and use -space at point from mepover and just set the fitting parameter

Thanks for your answer sovitek, but i have elements above my spaces, which i don t want to get involved in the spaces. so i cant do that

Hi allright just mean something here

Oh that note is from MEPover, i googled it and installed it and with installing dynamoironpython2.7 it works fine. just a.Name does not work. maybe it is just a placeholder? i ll try to find a way around it

→ this does not work either


WORKS! THANKS ALOT!!

1 Like

yeah sure its becoarse you have fitting outside a space it gives null you could try replace null with a empty string or filter these out