Changing Multiple Parameters using Element.Set.ParameterByName

Hello guys,

Currently I have a List of Elements and I want to change their “Mark” & “Comment” Parameters, but the Element.Set.ParameterByName Node only works if you feed it all the Marks first and then all of the Comments. Is it possible to pair the Marks with Comments and feed them into Element.Set.ParameterByName?

Hi Kaloyan, I think chopping your parameter name list (with a length of two) and switching the lacing of the element…setparameterbyname node to longest should do the trick.

Hi Koloyan,

You can try Replication Guides also.

Good Luck!

 

 

 

 

1 Like

Hello guys,

Thank you very much for all the wonderful suggestions :), they all work but not for what I am trying to achieve, now I have access to my script at home so I can be a bit more specific.

What I am trying to do is change the Level & Offset of Duct Fittings. The problem is when you try to change the level of a Fitting, from Level 0 to Level 1 for example (Level 0 - Elevation = 0, Level 1 Elevation = 4000) it changes the Level but not the Offset. If the Fitting is at Level 0 @ 1000 if you change it to Level 1 it will still be @1000 which means it will physically move by the difference in Levels, in our case 4000mm. The problem with this is that if you have a connected Ductwork system and you try to change the Level of a fitting it will break the system because it will try to offset by 4000mm and you have to reconnect the system. The workaround this is to select the fitting change the Level to 1 in the Properties Palette and before hitting apply remove the difference in levels from the Offset parameter, example: If the fitting is @ 1000 on Level 0, and you want to move it to Level 1 and keep its position in the model without breaking the system you have to select the fitting go the the Properties Palette change its Level to 1 and its Offset to -3000 (in our case) and then hit apply. Image 1 shows a typical scenario of fittings that I want to change.

My script works for single instance please see image 2 below (in a way the script changes the two parameter and then hits apply)

When I add more instances (image 3) it seems that its trying to first change the Level parameters and then the Offset parameters. Illustrated in words is something like - Change the Level of Fitting 1 - hit apply, change the Level of Fitting 2 - hit apply… and then go through the same procedure for Offsets.

I want it to look something like this - Change the Level and Offset of Fitting 1 - hit apply, change the Level and Offset of Fitting 2 - hit apply and so on… to me this looks like a Loop but I am pretty bad at scripts at the present moment and cannot figure out how to do it.

 

 

3

2

 

 

 

Same struggles I’m dealing with. In LISP you would have to create an index and step thru the index. I can’t figure out how to process a list of components myself right now.

Take a look at this post I started a while back. http://dynamobim.org/forums/topic/setting-multiple-parmaeters/

Thanks Steven,

I will have a good look at the discussion and try to solve it!

Regards

Kaloyan

I got the same situation as Kaloyan. Does anyone know how to solve it?

I have the same problem and ur solution works! thank you!