Change line style name

Hi everybody

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…

Hi K.Vistgaard,

Your using values as “String”. You need to use “Line Style” type. Refer this link http://dynamobim.org/forums/topic/set-line-style-of-detail-line-using-element-setparameterbyname/

Good Luck!

Hi Kulkul

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 http://dynamobim.org/forums/topic/excel-roundtrip-fill-patterns-line-styles-etc/

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.

Good Luck!

Yep… That seems more like it. :slight_smile:

But it’s a tough one. I will have a go soon. Let you know if i succeed. :slight_smile:

But thanks so far…!!

Hi,
I have the same issue but I couldn’t open the above link, any suggestions please??

2 Likes

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.

3 Likes

Here is a link to the old topic, however the images aren’t scalable so may not be much help anyways.

1 Like

Hi Gavin,
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 :+1:

1 Like

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.