Export doesn't work after new update

Hello together,

I wrote a C# component in gh in order to export geometries automatically. There, I used the code from Junichiro Horikawa. It worked well until new Rhino Update came. At the moment, I can’t export object automatically, when I open the gh.
Actually, Export component add guids ID to objects and select them. But, the following command doesn’t work

Rhino.RhinoApp.RunScript(“_-Exportieren " + Filename + " _Enter”, false)

How can I fix this problem?

deneme.gh (11.1 KB)

Instead of _-Exoprtieren use _-Export.

Hi Nathan,

actually, I used also “_-Export”. Unfortunately, it didn’t work either :frowning:

This works just fine on my end. I changed the path to an existing location on my machine and toggled Export to True. Objects were added and the .igs file was saved to the specified location. Importing it into a new document shows the exported object correctly.

You’ll have to provide more information, probably the Rhino command _SystemInfo will be needed, if you could post the information generated by that.

In my system, it doesn’t work, after I open gh document. But, if I change toggle first to false and then true, then it works. However, it should work automatically, after opening gh.

Here is the _SystemInfo information:

Rhino 7 SR23 2022-10-9 (Rhino 7, 7.23.22282.13001, Git hash:master @ a931168ca9426920ae6aa97218710b662f17fc39)
License type: Lab-Lizenz, Build 2022-10-09
License details: Cloud Zoo

Windows 10 (10.0.20348 SR0.0) (Server) or greater (Physical RAM: 1.3e+02Gb)

Computer platform: DESKTOP (Hosting Remote Desktop session)

Standard graphics configuration.
Primary display: Microsoft Remote Display Adapter (Microsoft) Memory: 0MB, Driver date: 6-21-2006 (M-D-Y).
> Remote Desktop display device with 16 connection(s)
- Windows Main Display using connection #0
- Secondary monitor using connection #1
Primary OpenGL: NVIDIA RTX A4000 (NVidia) Memory: 16GB, Driver date: 12-6-2021 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 472.84
> Accelerated graphics device with 0 adapter port(s)
- There are no monitors attached to this device!

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU’s maximum)

Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 12-6-2021
Driver Version: 30.0.14.7284
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 16376 MB

Rhino plugins that do not ship with Rhino
C:\Users\gh4617\AppData\Roaming\McNeel\Rhinoceros\packages\7.0\EleFront\4.2.2\ElefrontProperties.rhp “ElefrontProperties” 1.0.0.0

Rhino plugins that ship with Rhino
C:\Program Files\Rhino 7\Plug-ins\Commands.rhp “Commands” 7.23.22282.13001
C:\Program Files\Rhino 7\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 7\Plug-ins\RhinoRenderCycles.rhp “Rhino Render” 7.23.22282.13001
C:\Program Files\Rhino 7\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 7.23.22282.13001
C:\Program Files\Rhino 7\Plug-ins\rdk_ui.rhp “Renderer Development Kit UI”
C:\Program Files\Rhino 7\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 7\Plug-ins\IronPython\RhinoDLR_Python.rhp “IronPython” 7.23.22282.13001
C:\Program Files\Rhino 7\Plug-ins\RhinoCycles.rhp “RhinoCycles” 7.23.22282.13001
C:\Program Files\Rhino 7\Plug-ins\Grasshopper\GrasshopperPlugin.rhp “Grasshopper” 7.23.22282.13001
C:\Program Files\Rhino 7\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 7.23.22282.13001
C:\Program Files\Rhino 7\Plug-ins\Displacement.rhp “Displacement”

Not sure why it doesn’t work for you. Just opening the GH file has it automatically do everything

At this stage I can only guess, maybe Elefront is somehow interfering?

I deleted Elefront and it still doesn’t work :frowning:

I did test this in 7.24 (service release candidate), maybe there was an issue in 7.23 that I am not aware of. If there was then at least 7.24 works here.

Isn’t rhino 7.23 the newest Version? At least, it says so in my system. How could you have 7.24? :smiley:

7.23 is indeed the latest Service Release at this time of writin. 7.24 is the latest Service Release Candidate. You can get that as well by setting your Rhino update frequency to Service Release Candidate (Help > Check for updates…).

I upgraded the system to 7.24. But, still it doesn’t work. Should I call technical service?

Hi @Mertcan_Kaya, you might set the option for echo=true:

Rhino.RhinoApp.RunScript(cmd, true);

If you have hit the Toggle and the path is not found or other error happens, you get something like below:

grafik

btw. i would always recommend to put the path into double quotes which prevents problems if the path have spaces in it.

_
c.

1 Like

hi clement,

thank you for your replay. It works actually, if I hit the Toggle after opening. But, the problem is that it doesn’t work after opening directly.

Plug-in 3Dconnexion 3D Mouse blockieren.
Befehl: _-Grasshopper
Grasshopper option ( Window Document Solver Banner ): _Document
Grasshopper Document ( Open Save SaveAs Close CloseAll ): _Open
Grasshopper file ( Browse ): “X:\PhD\3D-Process\Validierung\Methanol_Synthese\Without_Cooling\deneme.gh”
Grasshopper file ( Browse ): _Enter
Befehl: _Enter
Befehl: _-Export
Grasshopper option ( Window Document Solver Banner )

after I open the gh, I get these messages in Runscript. Some words are german. But i think, it is understandable.

Hi @Mertcan_Kaya, looking at your command history output, it seems that the _-Export command is started but you’re not yet finished with the command prompt of the _-Grasshopper command as it still asks for options…

I speak german too :wink:
_
c.

works fine here as well. I’m pretty sure it has to do with the translations, I am not sure, is “Enter” used in German as well or is it more something like “Bestätigung” or “Eingabe”?
Try and replace

_Enter

by

_-Enter

or

_Eingabe

(IF this is the equivalent of Enter in rhino German, I honestly don’t remember)

I remember having problems with automation when I had rhino in German, as points are replaced by commas sometimes and similar silly format problems, that might influence the command in between brackets itself. I strongly recommend using Rhino in English for all automation.

Also, you want to put a button on the node and not a toggle.

hope this helps to find the source

Hi All,

There is some valuable information on command line scripting.

https://docs.mcneel.com/rhino/7/help/en-us/index.htm#information/rhinoscripting.htm

– Dale

I’m not sure the language is the problem. If the command is run like this:

_-Grasshopper

It suppresses opening the GH editor and usually runs the english version of the command. This should force all options to be in english so _Enter sould work. There is not a thing like _-Enter the - in front of a command suppresses it’s dialog and routes the dialog option values to the command prompt. Enter does not have a dialog.

My understanding from his posted command history text is that @Mertcan_Kaya wants to open the deneme.gh file from a fixed location and expects that the igs file is saved right when the definition is running the first time. This happens (works) when the gh file is opened manually and was saved with the Toggle enabled.

It fails however when the gh document is openend by scripting the _-Grasshopper command.

(tested with Rhino 7.24.22290.19001, 2022-10-17 in english language)

_
c.

Neither am I :). I just saw the file name did not make it through and I had some trouble a while ago with a similar task, when I worked with macros, but it’s a long while ago. I guess you looked deeper into this than I did, so I’m pretty sure you’re right.

Thank you for your reply. It is so interesting, because sometimes it works and sometimes not .How is it possible? :sweat_smile:

At the moment, I’m opening the gh script manually and expecting to export some geometries. After it works properly, I can open rhino from outside with a c# script. But, I should be sure first that my system works manual properly, then I can automate. It is not a big deal.

@clement, I thought that _-Grasshopper command is making the problem. Therefore, I added _Enter before my _-Export command in order to supress it. But, it didn’t work. As I said, I didn’t get it, how it is possible that my gh script works sometimes and sometimes not :sweat_smile:

Hi @Mertcan_Kaya,

tested this too and found the same, either with _Enter _Enter or _EnterEnd but it did not get out from the _-Grasshopper prompt and tried to run _-Export from the definition… :roll_eyes:

Below is the definition i’ve used for testing which never failed to save if it was opened like this:

  1. Open GH
  2. Open the definition

This version does save the file on the desktop, you can still set the filename.

deneme_cg.gh (10.0 KB)

_
c.