# Sampe Line Group - set Sample Line Style

**URL:** <https://forum.dynamobim.com/t/sampe-line-group-set-sample-line-style/80864>\
**Category:** Civil 3D\
**Tags:** python, civil3d\
**Created:** [September 9, 2022, 1:53pm UTC](https://forum.dynamobim.com/t/sampe-line-group-set-sample-line-style/80864 "2022-09-09T13:53:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JPS](https://avatars.discourse-cdn.com/v4/letter/j/b4bc9f/32.png) [@JPS](https://forum.dynamobim.com/u/JPS)\
**Post date:** [September 9, 2022, 1:53pm UTC](https://forum.dynamobim.com/t/sampe-line-group-set-sample-line-style/80864/1 "2022-09-09T13:53:28Z")

</div>

Hi All,

I’m searching for a solution to set the sampleline style.

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

Part of the Python code:

> ```
> for i in range(len(addsources)):
> tmpaddsource = addsources[i].lower()
> if tmpaddsource in tmpsource:
> if slgsource.SourceType == addsourcetypes[i]:
> slgsource.IsSampled = True
> print(slgsource.SourceType)
> if slgsource.SourceType == 0:
> slgsource.StyleName = "Additional Surface 4"
> if slgsource.SourceType == 2:
> slgsource.StyleName = "HW"
> 
> ```

The line “slgsource.StyleName = …” doesn’t work.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [September 11, 2022, 8:11am UTC](https://forum.dynamobim.com/t/sampe-line-group-set-sample-line-style/80864/2 "2022-09-11T08:11:16Z")

</div>

hi  
Is the problem solved?

 ![0](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/5/e5126744c176119d178541eed3684bdb54f62e64.jpeg)

---

<div class="post-metadata">

**Author:** ![JPS](https://avatars.discourse-cdn.com/v4/letter/j/b4bc9f/32.png) [@JPS](https://forum.dynamobim.com/u/JPS)\
**Post date:** [September 12, 2022, 5:54am UTC](https://forum.dynamobim.com/t/sampe-line-group-set-sample-line-style/80864/3 "2022-09-12T05:54:33Z")

</div>

My fault, The line “slgsource.StyleName = …” doesn’t work. The member “StyleName” doesn’t exits but the “StyleID” exits.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/6/b6fba0f67f9dfb450ca634e28bded2823f089f0e.png)

Found thread : [Get list of styles - #4 by Anton\_Huizinga](https://forum.dynamobim.com/t/get-list-of-styles/50556/4) but the python code doesn’t work in CPython.

I this case in can’t use the Camber node “Section.Styles”, this is a dropdown list. Why not?

I want to create a Style mapping Excel Sheet:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/9/f9e07ba7a7812858668b2948bad9ab09ee333bea.png)  
Hope this makes sense.

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [September 12, 2022, 2:30pm UTC](https://forum.dynamobim.com/t/sampe-line-group-set-sample-line-style/80864/4 "2022-09-12T14:30:47Z")

</div>

> [@JPS](#):
>
> I this case in can’t use the Camber node “Section.Styles”, this is a dropdown list. Why not?

Sorry @JPS, I’m not fully understanding. Could you elaborate?
