I write this code but not working. I want use pickpoint z or entered z coordinate at the same time. but first want getpoint I entred number not working. what can I do for this problem. if c# is my solution ı can write code in the c#.
In C# and python, it is not possible to get two different inputs of different types. Normally you would ask for a user input and check it is the correct type. So in this you might use instead, check if the user has selected a point and get the Z co-ordinate from that, if the user has not selected a point, then request user input. Check if the input is 3 number (a point) or a single number, the Z-co-ord.
If you are willing to delve into rhinocommon, I think this can be done with Rhino.Input.Custom.GetPoint() with an option:
import Rhino as R
import rhinoscriptsyntax as rs
import scriptcontext as sc
# make a GetPoint object
getter = R.Input.Custom.GetPoint()
# make an OptionInteger object
# it is needed to allow the getter to also get a number
int_option = R.Input.Custom.OptionInteger(2)
# add the OptionInteger to the getter
# tell the getter to run
# now the getter should have something, but first...
# setup default case for printing the result
msg = 'User did not select a point or enter a number...'
value = ''
# now test the getter result type
# it should match one of the Rhino.Input.GetResult enumeration types
# we are interested in the 'Option' type if the user entered a number
if getter.Result() == R.Input.GetResult.Option:
# change print result variables accordingly..
value = int_option.CurrentValue
msg = 'User entered a number: '
# or the 'Point' type, if a point was selected
elif getter.Result() == R.Input.GetResult.Point:
value = getter.Point()
msg = 'User selected a point: '
# print the result
print msg + str(value)