Accessing moi programmatically
All  1-5  6-11

Previous
Next
 From:  Michael Gibson
10176.6 In reply to 10176.1 
HI Burr, well AppDomains are a construct of the .NET/CLR environment. MoI does not use that so it doesn't know anything about AppDomains.

I'm not sure how Dave Morrill set up his interface from Python to MoI. MoI is not really designed currently to be controlled from another application. It might have been possible in MoI v1 and v2 which were based off of the Microsoft "COM Automation" scripting environment. MoI v3 and v4 are not based off of that anymore, the script engine is now included along with Moi to help keep things more self contained and portable.

One thing that you can do though is to generate a .js script file, then you can launch MoI.exe from your other program and pass it the .js script file name as a command line parameter. When MoI starts up, it looks to see if it was given a .js file name as a command line parameter and if so it will load and execute that script before showing its main window. That's how the batch file processing method works:
http://kyticka.webzdarma.cz/3d/moi/#Batch

I can probably resurrect a COM Automation interface for MoI at some point here but it is not in there right now, not since the v3 switch off of mshtml/jscript.dll to webkit/javascriptcore.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
10176.7 In reply to 10176.1 
Hi Burr, or another thing that could work would be to set up a shortcut key in MoI, say Alt+R and for the shortcut key give it a full path to a .js script file including the file extension, like: c:\scripts\myfile.js

Then from the other app you can write out that .js file and then send the MoI main window an Alt+R keyboard message to trigger it.

You could use something like AutoHotkey to trigger the keyboard message to MoI if your other program doesn't have a convenient way to trigger keystroke messages to a window.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
10176.8 
I'm still rooting for python:-)
But know very little about any of this.

Python subprocess.call, and pass an argument to MoI ???:
https://www.digitalocean.com/community/tutorials/how-to-use-subprocess-to-run-external-programs-in-python-3

also this link is trying to open notepad...:
https://stackoverflow.com/questions/204017/how-do-i-execute-a-program-from-python-os-system-fails-due-to-spaces-in-path

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  immortalx
10176.9 
I've never seen Dave's app before and so I searched a bit and realized that it indeed was a standalone app!
So, sorry everyone for the confusion. My assumption was based on what Max did with NodeEditor, which seems to work the way I described.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
10176.10 In reply to 10176.7 
Thanks Michael. I can move along from that...
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  wayne hill (WAYNEHILL5202)
10176.11 
FYI: Watching this thread with interest.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-5  6-11