Is there a way to automate the Script Compiler app (for Python and RhinoScripts), so we can have it open a project and compile it, without manually opening the compiler? Any command-line arguments available?
Do you mean something like this: winpython
sorry, can you clarify this part better?
Sure, so now, when I want to compile a project that consists of 1 or more scripts, I need to open the McNeel compiler, press āOā to open the compiler project file (that I have), then āBā to build the project, then either āPā for rhp file or āIā for rhi installer file.
I want to avoid that, I just want to externally (via script) tell compiler to run, open specific compiler project and ābuildā the project into a plugin.
you would have to compile an executable to command a compiler executable
or wait for this to arrive:
Thanks, can you elaborate? I am not sure if we are talking about the same thingā¦
as in dos/win an executable BAT file gives the possibility of carrying out a certain sequence of operations/commands simply by starting the file and up to this point this is the feasible part.
Iām not entirely sure if it can even operate another window
(basically simulates the CMD command line)
I see that I can drag-and-drop the *.rhc file into the RhinoScriptCompiler.exe icon and it automatically would compile the project, which is exactly what I am looking for except that instead of drag-and-drop I want to automate it from an external script. Is there a way to do this? Or as a workaround, emulate the drag-and-drop action from a script?
I canāt help you on this, I donāt know anything about it.
thanks for trying
@eirannejad I believe you are responsible for the current iteration of the script compiler in Rhino 8?
So I am able to do this:
Option Explicit
Call Main()
Sub Main()
Dim strFileName : strFileName = "C:\MyFiles\CompilerProject.rhc"
Dim oShell : Set oShell = CreateObject("WScript.Shell")
oShell.Run "C:\FullPathHere\RhinoScriptCompiler.exe " & strFileName
End Sub
It opens the compiler and does the job with compiling the plugin, which is āalmost thereā for me. So far it looks like it automatically creates *.rhp file, there is no choice to do *.rhi like the compiler offers. I donāt think the rhi vs rhp information is saved in the .rhc project file. Is there any way to control if I compile to rhp or rhi?
thanks-
ājarek
Hi @Jarek, is this an older version of the RhinoScriptCompiler ? (The current one does not create rhi
files anymore, but rhp
& yak
)
_
c.
Hi Clement, I guess it must be then (working fine for what I need though). Where do I get the new one?
I canāt seem to find it, I have Rhino 8 installed but not using it, and donāt see it there. Is it a standalone download?
~j
Hi @Jarek, theyāve removed it from the menu in R8 but itās still installed here:
C:\Program Files\Rhino 8\System\RhinoScriptCompiler.exe
btw. iāve almost forgot everything about vbScript but your problem sounded familiar so i searched through my old links and found this. Maybe you can get some information from it to solve the automation problem.
If not search for āpassing arguments to WScript.Shellāā¦
_
c.
Thanks Clement! I see now, the new (new?) Compiler is a bit different and by default generates both rhp and yak, no more rhi files. I will look into the automation but I think for now it gives me what I needed starting this post.
BTW - the old compiler, when the desitnation folder had the .rhp file already and in use, would create a copy named MyPlugin[1].rhp, to avoid conflict. The current one does say that, but no copy is created then. Do you have any experience with that behavior? It was actually quite helpful to have it the old way.
thanks again-
-j
No, i always overwrite and have Rhino closed. If youāre scripting compilation, you could check for an existing rhp
with the expected name before and then maybe back it up. (Or even check if the file is locked and cancel compilation).
_
c.