Jump to content

getParameterNamed() only working for integers?


Recommended Posts

---

Hi, i have a .txt that im reading with readListFile()

This is what it contains:
image.png.0d6bc06f6c5f9a2f5946f2b0facb93c9.png

With this code:

offtsetCoordinates = readListFile(offsetFile)
ballFinderOffsetX = (val(getParameterNamed(offtsetCoordinates,1))/1000)
ballFinderOffsetY = (val(getParameterNamed(offtsetCoordinates,2))/1000)
ballFinderOffsetZ = (val(getParameterNamed(offtsetCoordinates,3))/1000)
coordsys = getParameterNamed(offtsetCoordinates,4)

I get the two "0" values correctly because i guess they are integers and the rest is just "".

I could make the file comma seperated and then use 

offSetStuff=offsetFile.asFilename.contentsOfEntireFile
xOffset = val(strElement(1,",",offSetStuff)))
yOffset = val(strElement(2,",",offSetStuff)))
zOffset = val(strElement(3,",",offSetStuff)))
coordSys = val(strElement(4,",",offSetStuff)))

But i dont want that tbh. 

 

Is there a way to use getParamteterNamed() for that?

---
offtsetCoordinates = readListFile(offsetFile)
ballFinderOffsetX = (val(getParameterNamed("offtsetCoordinates",1))/1000)
ballFinderOffsetY = (val(getParameterNamed("offtsetCoordinates",2))/1000)
ballFinderOffsetZ = (val(getParameterNamed("offtsetCoordinates",3))/1000)
coordsys = getParameterNamed("offtsetCoordinates",4)
---
Posted (edited)

Hi Norbert,

here u see what im getting here (ignore the parenthesis in front of val(), it doesnt change the result)

And i swear, yesterday when testing the same code got me "" for 

coordsys = getParameterNamed("offtsetCoordinates",4)


image.png.17ea2f0c31c96d9efa4e70fac6ae9308.png

Edited
  • 4 months later...
---

i might be missing something here but i created a file like yours and have the same code, just simpler

got rid of "" 

i tried to add val() and still got same output

if i divide by 1000, i get -0.1d for last value

i attached my text file, try it with this and you will now if it is your file formating or calypso PCM

 

Test.txt

 

image.thumb.png.a1f47eddc986e028649bcae5f6d6b25b.png

Edited
×
×
  • Create New...