<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to set name of user water level in python API?</title><link>https://communities.bentley.com/products/geotech-analysis/f/forum/211700/how-to-set-name-of-user-water-level-in-python-api</link><description>waterlevel_s = g_i .waterlevel(( -50 , self . WaterLevelLeft ), ( 0 , self . WaterLevelLeft )) 
 
 I have a water level as can be seen above. I would like to give it a name so I can retrieve it later. I have tried &amp;quot; waterlevel_s.Name = &amp;quot;WL_Left_&amp;quot; + self</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to set name of user water level in python API?</title><link>https://communities.bentley.com/thread/641447?ContentTypeID=1</link><pubDate>Fri, 26 Mar 2021 13:21:05 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6fdd33c0-3dd4-4356-a06f-61a471dae784</guid><dc:creator>Micha van der Sloot</dc:creator><description>&lt;p&gt;Hi&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;This only works with user-generated water levels: the water levels generated by boreholes cannot be updated.&lt;br /&gt;Also note that each object should have a valid, safe object name, meaning e.g. it cannot contain spaces, start with a number, or have unsupported characters in the name, like a dot or a dash/hyphen.&lt;br /&gt;&lt;br /&gt;If you have a user water level, as you have in the above example it should work:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="python"&gt;# set water level elevation:
WaterLevelLeft = -1.5

# create a new PLAXIS User water level:
waterlevel_s = g_i.waterlevel((-50, WaterLevelLeft), (0, WaterLevelLeft))

# construct the new name for the water level:
newWLname = &amp;quot;WL_Left_&amp;quot; + str(WaterLevelLeft)

# remove any incorrect object name conditions:
newWLname = newWLname.replace(&amp;quot;.&amp;quot;,&amp;quot;_&amp;quot;).replace(&amp;quot;-&amp;quot;,&amp;quot;_&amp;quot;)

# finally, set the .Name value for this new waterlevel:
waterlevel_s.Name = newWLname&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>