Python it is read as a string while it is a float or a list

I am trying to offset a curve, but some data is read as a string.
I added a small part of the script wherein you can see the definition ‘works.’
But, when using it in a larger script it reads inputA or inputB as a string.

Do you know what I am doing wrong?
Thank you for your response. :slight_smile:

20190120 problem intersection guides 00.gh (8.3 KB)

Hi,

by just looking at your code from image, I immediately see you are passing 3 arguments, although your method just provides 2 arguments to be passed in. Weird Python syntax…

If you write self.method(arg1,arg2) its expecting a signature like this :classmethod(self,arg1,arg2):

Sometimes if you pass in a tuple you can also get an ArgumentTypeException.

1 Like

It is written within a class. I do not understand it right know, because when I add ‘self’ it says:

Runtime error (ArgumentTypeException): create_offsetcrv() takes exactly 2 arguments (4 given)

Traceback:
  line 101, in create_evaluationpnts, "<string>"

Do you might know what else I am doing wrong?

no, you need to add the “self” at the definition not at the call.

that said,

somewhere there is

class Foobar():
   [...]
   def create_offsetcrv(self,crvs,offsetval):
        print "offset"

   def do_something_else(self):
        self.create_offsetcrv(crvs,offsetval):
1 Like

Thank you TomTom :smiley: