'rhino3dm' has no 'File3dm' member

I keep getting this problem in any code editor: “Module ‘rhino3dm’ has no ‘File3dm’ member”.
All the libraries are installed and are up-to-date. Here is the simple code that I was trying to test compute.rhino3dm:

import rhino3dm as rh
import random
import math

model = rhino3dm.File3dm()

for i in range(10):
# print(i)
pt = rh.Point3d(random.uniform(-5, 5), random.uniform(-7, 7), 9)
model.Objects.AddPoint(pt)

model.Write(‘points.3dm’, 6)
or: model.Write(‘points.3dm’, 7)

You imported rhino3dm with the name rh. In that case you would write
mdel = rh.File3dm()

Hi Steve - I still get the same problem. In my initial post, I forgot to delete ‘as rh’ in my import rhino3dm.

what happens if you run the following script?

import rhino3dm
dir(rhino3dm)

Still the same and here is a screenshot of it.

Sorry, I meant an entire script with just those two lines. I want to make sure that dir actually returns a bunch if information to ensure rhino3dm is properly installed. Just type those two lines directly into the python interpreter

It does return rhino3dm contents.

Is File3dm listed in there?

Yes, it is listed.

oh wait, that output is PyLint output. Does the script actually run?

The script runs and no error in the terminal. But it does not create a 3dm file because of those problems.

If the script runs, then it sounds like pylint isn’t able to inspect the rhino3dm module which is not
a runtime problem.

Are you sure the file is not getting created? What is the working directory that points.3dm should be getting written to? What if you used an absolute path?

1 Like