Hippocode Posted April 25, 2013 Share Posted April 25, 2013 (edited) I'm trying to get values in a script from an excisting worksheet. These cells have the format "dimension" which doesn't seem to do very much. Anyway, my dim is set on CM, i've placed 100 in a cell and the script can get "100" als a real value out of it. Changing the dimension settings won't change anything. creating something with the value "100" will up its geometery, while doing the same with hardcoded "100cm" will work as intended... I can only assume, the retrieved "100" has no dimension at all, not even the current active dimension. Any suggestions ? Edited April 25, 2013 by hippothamus Quote Link to comment
Pat Stanford Posted April 25, 2013 Share Posted April 25, 2013 If you get the value from the cell, you will get exactly that, the value that is in the cell. If you are trying to use this value (that you know is cm) someplace where VW is expecting a dimension in another unit (like a PIO that was written in inches), you will get strange results when you paste the value in. Four possible options: 1. Make sure that where you are using the dimension is set to use dimensions rather than just straight numbers. This only works if it is all in your script. 2. Manually do the conversion in your script to the units the PIO is expecting. 3. Convert the value to a string and append the 'cm' to the end prior to using the value. 4. If you can live with the cm showing on every row in the worksheet just edit the format of the cells to include cm in the trailer and then use GetWSCellString. Quote Link to comment
JBenghiat Posted April 26, 2013 Share Posted April 26, 2013 For reading the values, ValidNumStr is your friend. Num2StrF is useful for writing. When dealing with worksheets, I have two versions of any variable I am reading -- one as formatted text and one as a number. HTH, Josh Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.