I made a python command following the directions listed here:
Rhino Dev Tutorial
This worked perfectly. When I run the command from Rhino, it asks for the user input and then outputs it back. However, if I try and import a new module in this code, such as numpy, for example, then Rhino crashes as soon as I run the command. How would I go about importing a module so that it’s accessible to commands? Thank you in advance!
Here is the code for the plugin causing the crash:
#import statements as needed:
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
import numpy as np #it works fine without this line, but crashes with this line.
#this line with the name of the command:
__commandname__ = "MyNewCommand"
def RunCommand( is_interactive ):
#Your code in here
user_input = ""
user_input = rs.GetString("Please input your request", user_input)
if user_input:
print("Got a user input: " + str(user_input))