Grasshopper

algorithmic modeling for Rhino

object rr = Rhino.RhinoApp.GetPlugInObject("RhinoScript");
    RhinoScript4.IRhinoScript rs = (RhinoScript4.IRhinoScript) rr;

    rs.EnableRedraw(false);
    rs.Command("print  enter enter", false);
    rs.EnableRedraw(true);

 

not working because i have to push the ok button

Views: 1392

Replies to This Discussion

Try prepending commands with a hyphen as it then surpresses dialogs.

 

ie. rs.Command("-print  enter enter", false);

 

Rhino help on this topic below.  I haven't tested this myself, but hope it helps.

 

Cheers,

 

Jon

 

-
(hyphen)

Suppress dialog box.

All commands are now scriptable at the command line (even commands that have dialog boxes by default). To suppress the dialog box and use command-line options, prefix the command name with a hyphen (-).

 

thanxs i think this helps....

 

Hi Michael,

in addition, these are two supported methods to call macros from .Net (C# and Vb.Net):

Using the Old .Net SDK:

  • RhUtil.RhinoApp().RunScript("-_Render", 1);
    // 0 turns off echo where possible

Using RhinoCommon:

  • Rhino.RhinoApp.RunScript("-_Render", true);
    // false turns off echo where possible

As Jon says, the - hyphenized versions of a command, where available, remove dialog boxes. The _ underscore allows to use the English version of command names also on localized systems.

Using the Microsoft-provided RhinoScript wrapper interface to call through .Net might work but it not recommended.

I hope this helps,

- Giulio

______________

giulio@mcneel.com
McNeel Europe

//RhinoScript4.RhinoScriptClass test = new RhinoScript4.RhinoScriptClass();
    Rhino.DocObjects.RhinoObject rh_obj = doc.Objects.Find(guuid_in);
    object rr = Rhino.RhinoApp.GetPlugInObject("RhinoScript");
    RhinoScript4.IRhinoScript rs = (RhinoScript4.IRhinoScript) rr;

    rs.EnableRedraw(false);

    rs.Command("_SelID " + guuid_in, true);
    rs.Command("_Zoom _Selected");
    rs.Command("_SelNone", true);
    // rs.Command("!-print ", true);
    rs.Command("-Zoom Factor 0.8", true);
    rs.Command("Pan UP", true);


    rs.EnableRedraw(true);

 

I need to print it to a file a i want to have a pdf binder

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service