Export to SVG challenge

It is very strange as it seems that it works for most of users, not a lot surely as Rh6 as it embedded.


I don’t use extra libraries, just theses with RhinoCommon and Grasshopper.
Is the plugin enabled ?
image

Yes - installed and enabled from Rhino start-up. I’ve just uninstalled it and tried a fresh install, but I’m still getting the same problem. How many locations are there from which I should delete folders? I could only find two - in App Data and Program Files\Common Files. There were no folders in Program Files (x86).

Not easy to know why there is a problem. Just to be sure I understand
if you use the menu and Save As, you see svg extension but nothing happens after. Is it that ?
Which windows have you ?
Which .Net?
https://docs.microsoft.com/fr-fr/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed

I’m running Windows 10, current version. .Net framework, according to the registry, is 4.7.2, with 3.0, 3.5. 4.0 all in place.

When I either type in saveas in the command line, or use the File > Save As menu, all I see is this:


When I select .svg, nothing much changes:


If I Save, there’s a pause (as though something is happening), but no file is created.

I don’t know how to help. This surely mean the UI is not showing !!!
@dale have you an idea why it doesn’t work ? Does I have to add something to form.Show ?

  protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            // Usually commands in export plug-ins are used to modify settings and behavior.
            // The export work itself is performed by the SaveAsSVGPlugIn class.

            var fd = new System.Windows.Forms.SaveFileDialog();            
            fd.Filter = "Scalable Vector Graphics LD | *.svg";
            fd.DefaultExt = "svg";
        

            if (fd.ShowDialog(Rhino.RhinoApp.MainWindow()) != System.Windows.Forms.DialogResult.OK)
                return Rhino.Commands.Result.Cancel;

            Rhino.FileIO.FileWriteOptions options = new Rhino.FileIO.FileWriteOptions();
            
            Form1 form = new Form1(fd.FileName, 1, doc, options);
            form.Show(RhinoApp.MainWindow());

            return Result.Success;
        }

Hey, @laurent_delrieu
This looks awsome. I have not tried yet to say if its working for me (not at the pc right now).

Currently I’m doing an svg/pdf-exporter for Grasshopper. Currently I’m looking for a way to convert a NURBS-Curve to multiple Bezier-Curves. As I can see u have done it here. Can u share some of ur references (any link is welcome) or in case u don’t mind, the code?

Greets
Mark

Hello
I already gave the code to someone, but I didn’t see any return.
Here is a zip containing the folder in Visual Studio.
SaveAsSVG.zip (2.0 MB)

Thanks a lot :blush:
I’m going to check it out soon…

The return is going to look something like that:
hello world.pdf (6.4 KB)

Hey,
I tried ur rhi-plugin to save as SVG…
it works like a charm… Amazing!

Rhino 6 / Win 10…

Greets
Mark

My plugin doesn’t work on rh6. Did you recompile it ?

@laurent_delrieu

Hi Laurent. Which “Dale” were you hoping would assist with this?

@laurent_delrieu,

I’m confused. What is it you want help with?

– Dale

As it seems that my plugin isn’t working for everybody. Is there a reason why winform could not work for some PC configuration? Is there special compilation parameters, .NET version … ?

Thanks

Hi @laurent_delrieu,

So is there code to review? How can I repeat the failure others are seeing?

– Dale

winform does look different on different win10 machines. I don’t know what cause this issue. Maybe it is time to give up winform.

Hello
thanks for the comment, I no more use my plugin so I stopped its development at Rhino 6. I hope native SVG export can now do better than my plugin (I didn’t check the way rhino export layer and also how rhino handle dimensions).
For the Winform question, I continue to code for others projects and I still use Winforms. I didn’t try WPF, nor Mono …

1 Like

Good to hear. Did you solve winform issue?