- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to run an external script from my add-in.
I have added to my add-in:
import adsk.core, adsk.fusion, traceback
from .SHCS import shcs <<<<< Added
from .FHSCS import fhscs <<<<< Added
handlers = []
def run(context😞
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
cmdDefs = ui.commandDefinitions
========== More code
class ShcsExecuteHandler(adsk.core.CommandEventHandler😞
def __init__(self😞
super().__init__()
def notify(self, args😞
eventArgs = adsk.core.CommandEventArgs.cast(args)
# Code to react to the event.
app = adsk.core.Application.get()
ui = app.userInterface
gotoShcs = shcs() <<<<< Changed from a message box that works, so I know it gets here.
========== Rest of the code
In the external script (SHCS.py which worked as a plain script) I have:
import adsk.core, adsk.fusion, traceback
import math, os
def shcs(): <<<<< Added and tabbed over the rest of the code till end
# Globals
_app = adsk.core.Application.cast(None)
_ui = adsk.core.UserInterface.cast(None)
strUnits = ''
========== Rest of the code
While debugging, it goes thru the add-in script with no errors until:
gotoShcs = shcs()
It then just sits there and does nothing.
I think I'm close from what I've seen in the forums, just can't figure it out.
Brad Bylls
Solved! Go to Solution.