Ansys Learning Forum Forums Discuss Simulation 3D Design How to import external library such as Numpy or Scipy to spaceclaim? Reply To: How to import external library such as Numpy or Scipy to spaceclaim?

Erik Kostson
Ansys Employee
Not sure - I would have written a c++ function (a bit old fashioned but it has a nice random generator) to generate the random numbers and use that compiled .dll in ironpython via the ctype module, but that is undocumented and unsupported so can not help.
The above might be a bit overkill if you need something simple and that exists in Ironpython.
Not sure what you are doing exactly but if you just want random numbers there is a module in ironpython called random that will do that like this:

import random
randomnr=random.randrange(1,10) # generates a random int number between 1 and 10, or
randomnr_two=random.randint(1,10) # generates a random int number between 1 and 10
randomnr_three=random.uniform(1.00,10.00)# generates a random float number between 1 and 10


All the best

Erik