Jump to content

getParameterNamed() only working for integers?


---
 Share

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?

Link to comment
Share on other sites

What exactly ist it that doesn't work with your first code? If I simulate it, I get 0, 0 and -0.1d

What exactly did you get and what did you expect instead?

I never had any problems reading mixed lists with getParameterNamed()

Edited
Link to comment
Share on other sites

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)
Link to comment
Share on other sites

 Share

×
×
  • Create New...