if you are doing this from an event handler, then it should be fine. Never do this within a solution.
Just keep in mind that you’ll need to use standard Grasshopper input parameters, not Hint-based scripting parameters. Compile a sample component with the Hints that you need, then choose to copy the code. It will show exactly what types are expected.
for Robert McNeel & Associates