String add parenthese to coordinates - help

Hi

I’ve got a problem with this part of my python script (keep in mind - I mostly use python to make elobrated macros)

In the begin I input numbers for it .

lpp = 264500
LOA = 277000
beam = 46000

later in the script i write this:

apcr1 =-lpp,5,-beam
apcr2 =lpp/2,beam,beam
rs.CurrentView(“Top”)
rs.Command("_selcrossing " + str(apcr1) + " " + str(apcr2) + " _enter")

in my rhino commandbar it shows this:

Command: _selcrossing
Drag a window to select objects: (-264500.0, 5, -46000)
Unknown command: (-264500.0, 5, -46000)
Drag a window to select objects: (132250.0, 46000, 46000)
Unknown command: (132250.0, 46000, 46000)
Drag a window to select objects: _enter

When it adds the coordinates to the rs.command it adds a paranthese around them.
How do I stop it?

Thanks

Astrid

apcr1 =-lpp,5,-beam creates a tuple. So str(apcr1) gives you a string representation of your tuple.

Maybe you want to format your coordinates directly into apcr1:

x=1
y=2
z=3

co = "%d,%d,%d" % (x,y,z)
print co

Use %f in the formatting string if you need floating point numbers instead of integers.

Thank you so much!
that did the trick :grinning: