Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac run #11

Open
rafaelpirolla opened this issue Apr 14, 2021 · 1 comment
Open

Mac run #11

rafaelpirolla opened this issue Apr 14, 2021 · 1 comment

Comments

@rafaelpirolla
Copy link

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
Copy link
Owner

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 :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants