JesusFreke / lalboard

A 3D-printed keyboard inspired by the DataHand
http://lalboard.com
Other
828 stars 58 forks source link

Mac run #11

Open rafaelpirolla opened 3 years ago

rafaelpirolla commented 3 years ago

Definitely not a lalboard issue but I may do a pull request for docs if I make this run.

If I try to run a script named lalboard from vscode and then try to debug a test one like this: test.py:

import adsk.core

from fscad import *
relative_import("./lalboard.py")
import lalboard

def design():
    sphere = Sphere(1)
    sphere.create_occurrence(True, scale=.1)

def run(_):
    lalboard.run_design(design)

It doesn't work.

If I put the code inside the lalboard.py script (without the relative_import of course), then it works from vscode... What's up with this naming convention from Fusion? Can't I just open the port for API usage in Fusion without this undocumented correlation between file name and script name...

JesusFreke commented 3 years ago

Hmm. My primary mode of running the scripts is via the fusionIdea plugin. I've tried to make running something from fusionIdea as similar as possible to how it would be run if it were added as a script in fusion's "scripts and add-ins" UI. But it's possible there are differences, especially when you start getting into more advanced/non-standard module scenarios like this.

If you figure out how to get it to work, I'd be happy to accept a pull request for some docs with your findings, as you mentioned. Or if you find a better way to do the import of lalboard.py, I'm all ears :).