r/OpenPythonSCAD • • Dec 19 '25

How to use functions from OpenSCAD files?

Simple and short question:

How do I do this?

// func.scad
function foo() = 10;

# test.py
func = osuse("func.scad")
cube(func.foo())

Looks straight forward, but I'm getting this error:

AttributeError: 'openscad.PyOpenSCAD' object has no attribute 'foo'

Does anyone have an idea?Simple and short question:How do I do this?// func.scad
function foo() = 10;

# test.py
func = osuse("func.scad")
cube(func.foo())Looks straight forward, but I'm getting this error:AttributeError: 'openscad.PyOpenSCAD' object has no attribute 'foo'Does anyone have an idea?

3 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/rebuyer10110 Dec 20 '25

Gotcha. I don't know too much about openscad functions to speak to it.

I bet /u/gadget3D can tell you more.