Giulio,
The solution you provided was very helpful. I felt it
necessary to modify it somewhat because I need to use the
numeric input values elsewhere in the script.The simple lesson is
that rs.Command CAN ONLY READ STRINGS and will not accept reptilian
artifacts such as TUPLES and LISTS. Check that everything between
the leading parenthesis and final parenthesis can be read as a string?
Therefore, I created a new set of string variables
reflecting the numeric values.In order to ensure that all
the numeric and string values were fully accounted for I
placed each of the string value below its numeric counterpart.
These last two paragraphs are something to help other novices like myself:
When creating the helix the program requires at least three
input points: start of helix axis, end of helix axis and the radius
of the helix. When I created my original version I made use of
a pre-assigned point for the radius of the helix. With your version
I noticed that you too used a point. But a radius is not a point
and in the dialog the function specifically asks for a radius!
Knowing that you knew what you were doing(…and I didn’t) I
substituted a radius value instead of a point. The net result is
that while the length of the helix is correctly drawn the radius is
not set and will follow the cursor movements on the screen. To
stop this requires manual input.
The only reason that I can work out why this occurs is that although
the user has input a radius value the script cannot know on which plane
to apply the value and waits around for the user to make a decision.Is
that why, when asking for a radius, it should really be looking for a point?
Regards,
Rhinopythonnovice
“”"
20140930_2_11:12-12:10 Modifying and using solution provided by
Giulio Piacinto of McNeel.
17:40-19:22 "
“”"
import rhinoscriptsyntax as rs
import math
import Rhino
import System
Helix_Length = 20.0
Helix_Radius = 3.0
Helix_Radius_Str = str(Helix_Radius)
Helix_Pitch = 2.0
Helix_Turns = Helix_Length/Helix_Pitch #Tidier if this is an integer value
Axis_StartPt = 0,0,0
Axis_StartPt_Str = “0,0,0"
Axis_EndPt = Helix_Length,0,0
Axis_EndPt_Str = str(Helix_Length)+”,0,0"
Pt_1 = 0,Helix_Radius,0
Pt_1_Str = “0,”+str(Helix_Radius)+",0"
Helix_Path = rs.Command("_Helix " + Axis_StartPt_Str +
" " + Axis_EndPt_Str +
" Turns=" + str(Helix_Turns) +
" Pitch=" + str(Helix_Pitch) +
" " + Pt_1_Str +
#“ReverseTwist=”+str(True) +
" Enter _Enter" )
Thanks Giulio for your help.