I believe you could solve your problem by creating a SKIN.dll, and then Export the Window Layout and save it with the same name as the SKIN.dll but with the .rhw file extension. Then when Rhino loads your skin, it will automatically apply your layout.
Here a link to a comment related to this that helped us solve a layout issue with our plugin:
The important method for us is the OnBeginLoadAtStartPlugIns() in here we load your main rhino plugin which starts up our application.
Because we name output of the skin project: JewelBeetle.Skin.dll
We then only need to have a saved Window Layout file names JewelBeetle.Skin.rhw in the same directory that the skin.dll is, and Rhino will automatically load it on startup and apply the window layout.
We do this instead of messing with loading Toolbars and Hiding UI Panels, etc. Instead we just setup everything the way we want it to be and the export the *.rhw file:
So in our case we name our layout JewelBeetle.Skin.rhw and include it in the folder we ship our software in, along side the plugin, and the JewelBeetle.Skin.dll file.
Once you’ve ran Rhino one time with the /scheme=YourPluginScheme name, it will create a registry entry here (or in Rhino 7 if that is your case):
Then you just need to add the SkinDLLPath key pointing to where your skin.dll file is.
From that point on, anytime you launch Rhino with your scheme name, it will load your skin.dll, which will load your plugin, and it will then load/apply your window layout.
Hope this helps, it took me a while to figure it out, but I think it is the best way to do this…
Once you get it all working well, you can create a very custom looking application making use of Rhino at it’s core:
Here is a batch file which will search the registry for the install location of Rhino, first looking for Rhino 8, and if not found, look for Rhino 7.
It will then launch Rhino with a Scheme and Framework switch. You can modify this as you need.
If your plugin is compiled for .Net 4.8 you can supply the /netfx switch, if it is compile for .Net Core then supply the /netcore switch.
Replace the MySchemeName with your scheme that you used to generate the registry section containing your skinDLLPath above. Scheme names are case-sensitive.
@echo off
REM Batch script to find and start Rhino executable from registry
REM First registry path (Rhino 8.0)
set "RegistryPath1=HKLM\SOFTWARE\McNeel\Rhinoceros\8.0\Install"
REM Second registry path (Rhino 7.0)
set "RegistryPath2=HKLM\SOFTWARE\McNeel\Rhinoceros\7.0\Install"
REM The value name to find in the registry
set "ValueName=ExePath"
set "ExePath="
REM Function to query the registry and get the exe path, handling spaces in path
for /f "tokens=2,*" %%A in ('reg query "%RegistryPath1%" /v "%ValueName%" 2^>nul') do (
set "ExePath=%%B"
)
REM If Rhino 8.0 is not found, check Rhino 7.0
if not defined ExePath (
for /f "tokens=2,*" %%A in ('reg query "%RegistryPath2%" /v "%ValueName%" 2^>nul') do (
set "ExePath=%%B"
)
)
REM If ExePath is still not defined, Rhino was not found
if not defined ExePath (
echo Rhino Not Found
) else (
REM Launch the Rhino executable, using quotes around the path to handle spaces
echo Rhino found at: "%ExePath%"
start "" "%ExePath%" /scheme=MySchemeName /netfx
)
pause
Hope this helps you get where you need to go. Let me know if you have questions.
I don’t understand your question, you asked if a batch file could be used to launch Rhino with a scheme, that is exactly what the batch file I wrote for you does.
Did you read my post above explaining how to change the scheme to match your situation?
This file once you edit it, could be shipped with your plugin.
You will still need to have a registry file to update the skindllparh for your scheme.