I am trying to change the name of my Line Styles - by using
Archi-Lab “Get All Line Styles” and set parameter by name…
This is the most forward way of doing it, but i can figure out if it is the right way…
At least it doesn’t work - the error says: “
Warning: Element.SetParameterByName operation failed. The parameter is read-only.”
Does anybody know a better way - or can point me in direction towards a solution…
Your using values as “String”. You need to use “Line Style” type. Refer this link
Yep, could imagine that this is the problem. And yes, at the refered blog, you get and change a line style.
But I want to get
all Line Styles in the Revit Model, and change the Name of them… Not just one selected…
Then in that case you need to read this topic
In that topic “Konrad” has shown very nice workflow how to change fill pattern name. you can use that as reference and change Line Styles names.
Yep… That seems more like it.
But it’s a tough one. I will have a go soon. Let
you know if i succeed.
But thanks so far…!!
I have the same issue but I couldn’t open the above link, any suggestions please??
yeah links would be great
Line styles are pretty complex. I worked with them in my package, Crumple a while ago.
This workflow can rename styles. Noting I’m filtering out the ones that come with Revit by default as they cannot be renamed.
Here is a link to the old topic, however the images aren’t scalable so may not be much help anyways.
now is the fun: let’s set the names and see if we can - I haven’t actually tried - LOL:
Damn, this proved to be a little bit more difficult than I thought. Anyways here it is:
First let’s break down our data coming back from Excel:
Let’s grab our id’s and convert them to integers so we can use them to extract our elements again:
Now, we can use archi-lab nodes to get an element by ID like so:
And lastly set the new names like so…
Could you please provide a little help. I’m trying to rename linetsyles adapting your script and getting an error with ‘Element.Setname’ node. Testing with your script gives the same error / warning.
BTW - Good work on the crumple package. if I hadn’t found this post I couldn’t have known about it.
Hrm it works on a test file for me, although for some reason your list structure looks different… which Revit version are you using? Pre-2020 I can’t guarantee the performance of my nodes unfortunately as 2020 is my build I work to and lowest I have installed typically.
test1.dyn (15.8 KB)
First things, first. Thanks for the quick response Gavin it’s much appreciated.
I should have stated I was working in Revit 2020.2.8.
Just tried the script I adapted in Revit 2021 and it’s working fine ,which is good. The issue is obviously down to the Revit version so I’ll live with it as most of our work is now 2022.
BTW - Change in name is due to re-branding and as this project is a one off I can live with it.
thanks again for the advise and the cool stuff in your dynamo package
You’re welcome! Odd that it’s behaving differently in other builds… ah well I’ll add it to my list to look into. Unfortunately my time is pretty scarce so I only tend to maintain Crumple against one build, at least for now. I’ll probably jump to 2022 once I move my BIM Guru content to that build also.