SBNote#

You can add notes in documents. They can be used, for example, to store experiment notebooks, descriptions, code snippets, etc. This notes can be accessed and modified from Python and in SAMSON using the Inspector.

Create and add a note#
    # construct a note
    note = SBNote('Experiment note', 'A description of an experiment...')

    # make the operation undoable
    with SAMSON.holding('Add note'):
            SAMSON.hold(note)
            # create a note node
            note.create()
            # add it to the active document
            SAMSON.getActiveDocument().addChild(note)

See also

SAMSON SDK: SBDDocumentNote

class samson.SBNote(*args, **kwargs)#

Bases: SBNode

This class describes a note.

Overloaded function.

  1. __init__(self: samson.SBNote) -> None

Constructs a note.

  1. __init__(self: samson.SBNote, name: str) -> None

Constructs a note with the given name.

Parameters:

name (str) – A name of the note.

  1. __init__(self: samson.SBNote, name: str, text: str) -> None

Constructs a note with the given name and text.

Parameters:
  • name (str) – A name of the note.

  • text (str) – A text in the note.

Examples

Add a note to the active document and make this operation undoable.

>>> note = SBNote('Experiment note', 'A description of an experiment...')
>>> with SAMSON.holding('Add note'):
...             SAMSON.hold(note)
...             note.create()
...             SAMSON.getActiveDocument().addChild(note)
True
getNextNote(self: samson.SBNote) samson.SBNote#

Returns the next Note.

getPreviousNote(self: samson.SBNote) samson.SBNote#

Returns the previous Note.

property text#

The note’s text.