Coding for toolbar button are dividers ok and what of V5 codes?

Hi,
I have a .rvb code and it has dividing lines,

Do the dividers such as this do harm ? ‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’

I struggle to know what of the initial description and author references are ok.

I recall in Internet page coding a way of inhibiting lines with a single character insert at line start.

to make usable for a button, bold I have added, italics I have deleted, inc the dividers after the )

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’

’ ObjectNotes.rvb – May 2015

’ If this code works, it was written by Dale Fugier.

’ If not, I don’t know who wrote it.

’ Works with Rhino 5.

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’

-_Runscript (

Option Explicit

Const STR_NOTES = “Notes”

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’

’ Adds notes to an object

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’

Call Main()

Sub Main()

Sub SetObjectNotes

Dim strObject, strOldNotes, strNewNotes

strObject = Rhino.GetObject(“Select object”, 0, True)

If IsNull(strObject) Then Exit Sub

strOldNotes = Rhino.GetUserText(strObject, STR_NOTES, False)

If IsNull(strOldNotes) Then strOldNotes = “”

strNewNotes = Rhino.EditBox(strOldNotes, “Edit object notes”, “Object Notes”)

If Not IsNull(strNewNotes) Then

Call Rhino.SetUserText(strObject, STR_NOTES, strNewNotes, False)

End If

End Sub

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’

’ Deletes notes from objects

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’

Sub DeleteObjectNotes

Dim arrObjects, strObject

arrObjects = Rhino.GetObjects(“Select objects”, 0, True, True)

If IsArray(arrObjects) Then

For Each strObject In arrObjects

Call Rhino.SetUserText(strObject, STR_NOTES, False)

Next

End If

End Sub

)

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’

’ Drag & drop support

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’

Rhino.AddStartUpScript Rhino.LastLoadedScriptFile

Call Rhino.AddAlias(“SetObjectNotes”, “_-RunScript (SetObjectNotes)”)

Call Rhino.AddAlias(“DeleteObjectNotes”, “_-RunScript (DeleteObjectNotes)”)

It says its for V5, can I cause instability by using codes for V5 in V7 and how do I tell which ones are safe to use ?

I dont want to mess up my V7 install that is taking a week what with hand editing all in properties.
I want to finish V7 then back up PC and move on.

Steve

They are comments only, so no harm. They help with readability, in this case highlighting comments that are important.

I tried pasting the code into the RhinoScript Editor and I see there is a problem. I don’t know how but the ’ used for commenting doesn’t mark the line as a comment when it should, so this may be causing you problems.

Should look more like this… Green text are comments.

There’s something wrong with the formatting too, the syntax of even the Sub on line 27 is bogus, see how there’s the curly red underline. Pasting back and forth to notepad doesn’t appear to fix it.

And the double quotes for defining a string aren’t the correct ones either.

Sub Main () has no End Sub and doesn’t do anything.

The Rhino.AddAlias functions at the bottom add references to the subs SetObjectNotes and DeleteObjectNotes, so just comment out anything to do with Main.

Lots of extra spaces in the code too.