Forgot password?

Create an account!

Forum

« back

RhinoScript – Classes in Rhinoscript

Messages

Please log in to write a message.

  • 11. aranna (Jun 02, 2011 16.08):

    tanxs to johannes for links
    this is very usefull tanxs

  • 10. Johannes (Jun 01, 2011 08.09):

    here is a collection of vb(date)-functions:
    www.w3schools.com/VBscript/vbscript_ref_functions.asp

    johannes

  • 9. aranna (May 31, 2011 18.29):

    thanx
    but not this one
    its output alwasy "5/31/2011"

    exp. vb functions DateTime Format

    Format specifiers Output
    d, M 31, 5
    d MMMM 31 May
    dddd, d MMMM yyyy Tuesday, 31 may 2011 <--- exspecialy this one

    How the Rhino script code for "Tuesday, 31 may 2011"?



  • 8. Johannes (May 29, 2011 14.17):

    you can use some vb functions for it.... like:

    x = Time
    x = Date
    x = Now
    ...

    johannes

  • 7. aranna (May 27, 2011 16.38):

    how i create the datetime format in rhino script code like this "dddd, d mm yyyy"?

  • 6. Hanno (Aug 05, 2008 21.24):

    Hi,

    classes are not Rhinoscript-specific, but a general programming concept. Look for "object-oriented programming" if you want to know more.

    Hanno

  • 5. _aLinG_ (Aug 05, 2008 20.06):

    I don't know what function makes "Class" command in Rhinoscript.

    Would you main to give me a little explanation?

    Thanx.

    Best Regards.

  • 4. Hanno (Jul 31, 2008 15.05):

    Well, it seems this command has only been added in RhinoScript 4.0 SR3, so you need to update your Rhino.

  • 3. Zechelon (Jul 31, 2008 14.23):

    Rhino says me that it dont know the command "ResetRhinoScript" :-(

  • 2. Hanno (Jul 31, 2008 11.21):

    Hi,

    this is indeed a problem. It happens because all globally defined variables, classes and functions stay in Rhino's memory until the script engine is reinitialized.
    As far as I know, the only way to solve this is to actually reset the scripting engine every time you run the script. This can be done with the "ResetRhinoScript" command (or

    rhino.command("ResetRhinoScript")

    . Unfortunately you cannot do this in the same script as your class definition, because the error is raised before the engine is reset... so the easiest way might be to run the command manually. BUT by reinitializing you lose all other globally defined things, too (like functions from library scripts that are run after Rhino starts).

    It's no easy life with classes in RhinoScript... if you find some better solution, tell me! :-)

    Greetings

    Hanno

  • 1. Zechelon (Jul 31, 2008 11.03):

    Hello to everybody,
    if I use classes in rhinoscript, I declare then like:

    Class Wabe
           
            Public Sub Generate(x,y,z,a)
                 ...
                 ...
            End Function

    End Class

    I can use this and I'am happy. But if I start the script again, there comes a error: "Laufzeitfehler Zeile 1. Name bereits definiert"...

    If I change then the classname, there is no problem, or I can restart Rhino.
    Cause' this I renumber my classnames everytime I start my script. After a flew hours work the class means Wabe98 insteat of Wabe........

    Does everybody know how I can dreregister my class after using my script?

    thanks!
    ZEchelon

Recommend

Why are these buttons gray?