XANSYS Forum Index
    Register    

FAQ    Search    Memberlist    Usergroups    SmartFeedSmartFeed    Profile    Log in
Decimal value unread - scripting in WB again !
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    XANSYS Forum Index -> XANSYS
Author Message
remi.bouton
User


Joined: 29 Apr 2015
Posts: 21

PostPosted: Thu Jun 18, 2015 2:30 am  Reply with quote

Hi,

I'm currently working again on scripting with WB.

It works great to update an assembly but something curious appends : I can't load a decimal value in Excel to export it on WB ??

As you know WB doesn't like any "dot" to enter a decimal value but it prefer a "," and I think that's what's happening here.

if I enter the number 6.1mm it is transferred as " 6;1 " and so an error occur.

I con't find a way to say that the "," is for a decimal value.



Anyone got an Idea how to deal with decimal number while scripting with WB ?
_________________
Rémi Bouton
GE Energy intern - Massy - France.
Back to top
View user's profile Send private message
Martin Liddle
User


Joined: 15 Aug 2008
Posts: 1274
Location: Chesterfield, UK

PostPosted: Thu Jun 18, 2015 3:03 am  Reply with quote

On 18/06/2015 10:30, remi.bouton wrote:
Quote:
It works great to update an assembly but something curious appends : I can't load a decimal value in Excel to export it on WB ??

As you know WB doesn't like any "dot" to enter a decimal value but it prefer a "," and I think that's what's happening here.

if I enter the number 6.1mm it is transferred as " 6;1 " and so an error occur.

I con't find a way to say that the "," is for a decimal value.

is this a Windows Regional Settings issue? In Control Panel>Region and
Language>Additional settings what is the decimal point character?

--
Martin Liddle, Tynemouth Computer Services,
Chesterfield, Derbyshire, UK.
www.tynecomp.co.uk

+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
_________________
Martin Liddle, Tynemouth Computer Services,
Chesterfield, UK.
Back to top
View user's profile Send private message Visit poster's website
remi.bouton
User


Joined: 29 Apr 2015
Posts: 21

PostPosted: Thu Jun 18, 2015 4:36 am  Reply with quote

Hi,

It's not a matter of language but a python code problem.

I'm just wondering how to enter a decimal number in Ansys via Excel because as I already shown Ansys WB doesn't recognize the "," and fill the cell with a 6;1 rather than "6,1".

In the python code I must specify the unit of the dimension filled out but is this there I must write that the dimension could be a decimal value ?
Back to top
View user's profile Send private message
remi.bouton
User


Joined: 29 Apr 2015
Posts: 21

PostPosted: Thu Jun 18, 2015 4:36 am  Reply with quote

Hi,

It's not a matter of language but a python code problem.

I'm just wondering how to enter a decimal number in Ansys via Excel because as I already shown Ansys WB doesn't recognize the "," and fill the cell with a 6;1 rather than "6,1".

In the python code I must specify the unit of the dimension filled out but is this there I must write that the dimension could be a decimal value ?
_________________
Rémi Bouton
GE Energy intern - Massy - France.
Back to top
View user's profile Send private message
remi.bouton
User


Joined: 29 Apr 2015
Posts: 21

PostPosted: Thu Jun 18, 2015 11:12 pm  Reply with quote

No one got an Idea how to solve that problem ?
_________________
Rémi Bouton
GE Energy intern - Massy - France.
Back to top
View user's profile Send private message
winfried.schepers
User


Joined: 21 Oct 2008
Posts: 43

PostPosted: Fri Jun 19, 2015 3:09 am  Reply with quote

Rmi,

I suspect Martin is correct in pointing to the regional settings in your Windows installation. I occasionally have this decimal-comma vs. decimal point problem with other software, too. If your Excel installation uses a comma for your decimal numbers, then you do not have English regional settings applied. Then if Python or WB or whatever reads the Excel file, the correctness of the import depends on if the importing software correctly determines the regional settings of your Windows and the regional settings to which the contents of the Excel file adhere, and does some appropriate transformations while it interpretes the contents of the Excel cell.

In your case in Excel you're obviously using a decimal comma and the semi-colon (;) for the separation of parameters in an Excel formula. That is the default in a German Windows installation, and most probably also in a French Windows, hence that is stored in your Excel file. Now WB reads that file, but does not care for regional settings of your Excel file, but effectively assumes US English. WB however is nevertheless well aware of the regional settings of your Windows. Hence it reads the (English) comma, transforms that to the (French) semicolon, and that is what you see on your screen.

What I usually do is temporarily switch my regional settings to US English. If you then open your Excel file, Excel will show a decimal point where you previously typed a comma. Then use Python or WB to import the Excel file. That works well for SAP2000, to give another example of FE software which does not correctly use the Windows RTL.

You can even convince Windows to use a decimal comma with US English regional settings, but that will definitely provide even more confusion.

With best regards,

Winfried Schepers

------------------------------------------------------------
Dr. Winfried SCHEPERS
mail: schepers@gudconsult.de
Phone +49 30 789089-806
------------------------------------------------------------

GuD Geotechnik und Dynamik Consult GmbH
Darwinstrasse 13
10589 Berlin
Germany

Tel. +49 30 789089-0
Fax +49 30 789089-89

Managing Directors:
Dr. rer. nat. Gtz Hirschberg, Dr.-Ing. Fabian Kirsch,
Dr.-Ing. Jens Mittag, Dipl.-Ing. Univ. Nikolaus Schneider,
Dr.-Ing. Silke Appel (ppa.), Dipl.-Ing. Kerstin Deterding (ppa.),
Dipl.-Ing. Hilmar Leonhardt (ppa.), Dipl.-Ing. Josef-A. Patron (ppa.)

Senior Partners:
Prof. Dr.-Ing. Kurt-M. Borchert, Dipl.-Ing. Hans L. Hebener,
Prof. Dr.-Ing. Thomas Richter, Univ. Prof. Dr.-Ing. Stavros Savidis

HRB 16 439 B AG Charlottenburg



Quote:
-----Original Message-----
From: Xansys [mailto:xansys-bounces@xansys.org] On Behalf Of
remi.bouton
Sent: 19 June, 2015 08:12
To: xansys@xansys.org
Subject: Re: [Xansys] Decimal value unread - scripting in WB again !

No one got an Idea how to solve that problem ?

------------------------
Rémi Bouton
GE Energy intern - Massy - France.






+-------------------------------------------------------------+
| XANSYS web - www.xansys.org/forum |
| The Online Community for users of ANSYS, Inc. Software |
| Hosted by PADT - www.padtinc.com |
| Send administrative requests to xansys-mod@tynecomp.co.uk |
+-------------------------------------------------------------+

Post generated using Mail2Forum (http://www.mail2forum.com)
Back to top
View user's profile Send private message
remi.bouton
User


Joined: 29 Apr 2015
Posts: 21

PostPosted: Sun Jun 21, 2015 11:10 pm  Reply with quote

It works thanks !

I first didn't understand where to change that language parameter, I though it was in Ansys interface itself.

Thanks a lot to begin the week with something working at last ^^ !
_________________
Rémi Bouton
GE Energy intern - Massy - France.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    XANSYS Forum Index -> XANSYS
All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

sleek template created by Andrew Charron