# Change line style name

**URL:** <https://forum.dynamobim.com/t/change-line-style-name/3429>\
**Category:** Packages\
**Created:** [March 15, 2016, 5:25am UTC](https://forum.dynamobim.com/t/change-line-style-name/3429 "2016-03-15T05:25:11Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![K.Kvistgaard](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/k.kvistgaard/32/156904_2.png) [@K.Kvistgaard](https://forum.dynamobim.com/u/K.Kvistgaard)\
**Post date:** [March 15, 2016, 5:25am UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/1 "2016-03-15T05:25:11Z")

</div>

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…

 ![ChangeLineStyleName_Error](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/b/b05585dc63b96cd80e0b6d3c1d4924a24e33592c.png)

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [March 15, 2016, 7:37am UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/2 "2016-03-15T07:37:38Z")

</div>

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/](http://dynamobim.org/forums/topic/set-line-style-of-detail-line-using-element-setparameterbyname/)

Good Luck!

---

<div class="post-metadata">

**Author:** ![K.Kvistgaard](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/k.kvistgaard/32/156904_2.png) [@K.Kvistgaard](https://forum.dynamobim.com/u/K.Kvistgaard)\
**Post date:** [March 16, 2016, 7:12am UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/3 "2016-03-16T07:12:06Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Kulkul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/kulkul/32/49801_2.png) [@Kulkul](https://forum.dynamobim.com/u/Kulkul)\
**Post date:** [March 16, 2016, 7:59am UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/4 "2016-03-16T07:59:44Z")

</div>

Then in that case you need to read this topic [http://dynamobim.org/forums/topic/excel-roundtrip-fill-patterns-line-styles-etc/](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!

---

<div class="post-metadata">

**Author:** ![K.Kvistgaard](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/k.kvistgaard/32/156904_2.png) [@K.Kvistgaard](https://forum.dynamobim.com/u/K.Kvistgaard)\
**Post date:** [March 18, 2016, 4:25am UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/5 "2016-03-18T04:25:34Z")

</div>

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…!!

---

<div class="post-metadata">

**Author:** ![niakiki](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@niakiki](https://forum.dynamobim.com/u/niakiki)\
**Post date:** [April 14, 2020, 7:59pm UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/6 "2020-04-14T19:59:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [September 24, 2021, 3:28am UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/7 "2021-09-24T03:28:21Z")

</div>

yeah links would be great

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [September 24, 2021, 12:19pm UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/8 "2021-09-24T12:19:44Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/2/727702e42675e73c8279ac60153db7f1cc5f9844.png)

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [September 24, 2021, 12:21pm UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/9 "2021-09-24T12:21:39Z")

</div>

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

> [@Excel Roundtrip - Fill Patterns, Line Styles etc](https://forum.dynamobim.com/t/excel-roundtrip-fill-patterns-line-styles-etc/1973/4):
>
> 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: [Capture1] &nbsp; &nbsp; &nbsp; Let’s grab our id’s and convert them to integers so we can use them to extract our elements again: &nbsp; [Capture1] &nbsp; &nbsp; Now, we can use archi-lab nodes to get an element by ID like so: &nbsp; [Capture1] &nbsp; &nbsp; And lastly set the new names like so…

---

<div class="post-metadata">

**Author:** ![mark.jollyR7W78](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mark.jollyR7W78](https://forum.dynamobim.com/u/mark.jollyR7W78)\
**Post date:** [April 27, 2022, 12:33pm UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/10 "2022-04-27T12:33:01Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/e/4ea9e38aa3f0c582f1648ad141a48f5b68d07f94.png)

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [April 27, 2022, 3:04pm UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/11 "2022-04-27T15:04:01Z")

</div>

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](https://forum.dynamobim.com/uploads/short-url/hixADgc9ZtyMsLfPk6CZz9wbfIu.dyn) (15.8 KB)

 ![test1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/9/2941065aa3f354b3ba765f48fb3352399d11a31e.png)

---

<div class="post-metadata">

**Author:** ![mark.jollyR7W78](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mark.jollyR7W78](https://forum.dynamobim.com/u/mark.jollyR7W78)\
**Post date:** [April 27, 2022, 4:38pm UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/12 "2022-04-27T16:38:24Z")

</div>

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 👍

---

<div class="post-metadata">

**Author:** ![GavinNicholls](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gavinnicholls/32/190442_2.png) [@GavinNicholls](https://forum.dynamobim.com/u/GavinNicholls)\
**Post date:** [April 27, 2022, 11:41pm UTC](https://forum.dynamobim.com/t/change-line-style-name/3429/13 "2022-04-27T23:41:29Z")

</div>

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.
