SAMSON LibraryΒΆ

This module is the main interface.

You can access some of SAMSON functionality directly from this module, for example:

activeDocument = SAMSON.getActiveDocument()

See also

SAMSON API: samson

This class is the main interface of SAMSON. It acts as a facade that centralizes and exposes other functions from the SAMSON API to make it easy for developers to interact with SAMSON, the data graph, etc. All functions in this class are static.

class samson.Facade.SAMSON.UserPlan(self: samson.Facade.SAMSON.UserPlan, arg0: int) → NoneΒΆ

Bases: pybind11_builtins.pybind11_object

Members:

None

Starter

Standard

Professional

Enterprise

Enterprise = UserPlan.EnterpriseΒΆ
None = UserPlan.NoneΒΆ
Professional = UserPlan.ProfessionalΒΆ
Standard = UserPlan.StandardΒΆ
Starter = UserPlan.StarterΒΆ
nameΒΆ

(self – handle) -> str

samson.Facade.SAMSON.askUser(dialogTitle: str, dialogText: str) → boolΒΆ

Asks a question to the user with a message in a modal pop-up dialog

samson.Facade.SAMSON.beginHolding(name: str) → NoneΒΆ

Begins holding

samson.Facade.SAMSON.captureViewport(width: int, height: int, transparentBackground: bool = False) → QImageΒΆ

Captures the viewport

samson.Facade.SAMSON.captureViewportToFile(filename: str, width: int, height: int, transparentBackground: bool = False) → NoneΒΆ

Captures the viewport into file

samson.Facade.SAMSON.disableHolding() → NoneΒΆ

Pauses holding

samson.Facade.SAMSON.enableHolding() → NoneΒΆ

Resumes holding

samson.Facade.SAMSON.endHolding() → NoneΒΆ

Ends holding

samson.Facade.SAMSON.exit() → NoneΒΆ

Exits SAMSON with a dialog

samson.Facade.SAMSON.exportToFile(*args, **kwargs)ΒΆ

Overloaded function.

  1. exportToFile(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, fileName: str) -> None

Export a selection of nodes to a file

  1. exportToFile(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, fileName: str, parameters: List[str]) -> None

Export a selection of nodes to a file with parameters specific to each exporter

samson.Facade.SAMSON.getAction(*args, **kwargs)ΒΆ

Overloaded function.

  1. getAction(actionUUID: samson.Core.Container.UUID) -> SBGAction

Returns the action with the given actionUUID

  1. getAction(actionUUID: str) -> SBGAction

Returns the action with the given actionUUID

samson.Facade.SAMSON.getActiveCamera() → samson.DataModel.Document.CameraΒΆ

Returns the active camera

samson.Facade.SAMSON.getActiveDocument() → samson.DataModel.Document.DocumentΒΆ

Returns the active document

samson.Facade.SAMSON.getActiveStructuralModel() → SBMStructuralModelΒΆ

Returns the active structural model

samson.Facade.SAMSON.getAtom(x: int, y: int) → SBMStructuralModelNodeAtomΒΆ

Returns the atom at location (x, y) in the viewport

samson.Facade.SAMSON.getAtomRadius() → samson.DataModel.Quantity.unitsSIΒΆ

Get the radius of atoms in the default representation of structural models

samson.Facade.SAMSON.getAtomicWeight(element: SBMElement::Type) → samson.DataModel.Quantity.unitsSIΒΆ

Returns the atomic weight of periodic table element element

samson.Facade.SAMSON.getBlock(element: SBMElement::Type) → strΒΆ

Returns the block of periodic table element element

samson.Facade.SAMSON.getBond(x: int, y: int) → SBMStructuralModelNodeBondΒΆ

Returns the bond at location (x, y) in the viewport

samson.Facade.SAMSON.getBondRadius() → samson.DataModel.Quantity.unitsSIΒΆ

Get the radius of bonds in the default representation of structural models

samson.Facade.SAMSON.getColorFromUser(dialogTitle: str = 'Choose a color') → tupleΒΆ

Gets a color from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getColorPaletteFromUser(dialogTitle: str = 'Choose a color palette', defaultColorPalette: samson.DataModel.Color.ColorPalette = 0) → tupleΒΆ

Gets a color palette from the user in a modal pop-up dialog. If the defaultColorPalette is provided it is set as a default one in the color palette dialog

samson.Facade.SAMSON.getCovalentRadius(element: SBMElement::Type) → samson.DataModel.Quantity.unitsSIΒΆ

Returns the covalent radius of periodic table element element

samson.Facade.SAMSON.getCurrentSelectionFilter() → strΒΆ

Returns the current selection filter name

samson.Facade.SAMSON.getDeepSelectionFlag() → boolΒΆ

Returns whether the user wants deep selection

samson.Facade.SAMSON.getDoubleFromUser(dialogTitle: str, minimum: float, maximum: float, singleStep: float = 1.0, prefix: str = '', suffix: str = '', decimals: int = 2) → tupleΒΆ

Gets a number from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getElectronegativity(element: SBMElement::Type) → samson.DataModel.Quantity.unitsSIΒΆ

Returns the electronegativity of periodic table element element

samson.Facade.SAMSON.getElementFromUser(dialogTitle: str = 'Set a string') → tupleΒΆ

Gets a periodic table element from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getElementName(element: SBMElement::Type) → strΒΆ

Returns the name of the periodic table element corresponding to a given type

samson.Facade.SAMSON.getElementSymbol(element: SBMElement::Type) → strΒΆ

Returns the symbol of the periodic table element corresponding to a given type

samson.Facade.SAMSON.getElementTypeByName(elementName: str) → SBMElement::TypeΒΆ

Returns the periodic table element type corresponding to a given name

samson.Facade.SAMSON.getElementTypeBySymbol(elementSymbol: str) → SBMElement::TypeΒΆ

Returns the periodic table element type corresponding to a given symbol

samson.Facade.SAMSON.getElementsFromUser(dialogTitle: str = 'Set a string') → tupleΒΆ

Gets periodic table elements from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getFileNameFromUser(dialogTitle: str = 'Choose a filename', dir: str = '', filter: str = '') → tupleΒΆ

Gets a filename from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getFileNamesFromUser(dialogTitle: str = 'Choose a filename', dir: str = '', filter: str = '') → tupleΒΆ

Gets filenames from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getGroup(element: SBMElement::Type) → intΒΆ

Returns the group of periodic table element element

samson.Facade.SAMSON.getIntegerFromUser(dialogTitle: str, minimum: int, maximum: int, singleStep: int = 1, prefix: str = '', suffix: str = '') → tupleΒΆ

Gets a number from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getItemFromUser(dialogTitle: str, label: str, items: List[str], current: int = 0) → tupleΒΆ

Gets an item from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getMousePositionInViewport() → QPointΒΆ

Returns the current mouse position in viewport coordinates

samson.Facade.SAMSON.getMultipleBondDisplayFlag() → boolΒΆ

Returns true when bonds are displayed with a variable number of cylinders to represent their order

samson.Facade.SAMSON.getNode(x: int, y: int, selectionFilter: str = '*') → samson.DataModel.DataGraph.NodeΒΆ
Returns the node at location (x, y) in the viewport based on the selection filter selectionString.
For selectionString use the Node Specification Language (SAMSON API: pagenodespecificationlanguage)
samson.Facade.SAMSON.getNodes(*args, **kwargs)ΒΆ

Overloaded function.

  1. getNodes(x: int, y: int, width: int, height: int, selectionFilter: str = β€˜*’, deepSelectionFlag: bool = False) -> samson.DataModel.DataGraph.NodeIndexer
Returns the nodes (in a node indexer) found inside the viewport rectangle (x, y, width, height) and based on a selectionString.
For selectionString use the Node Specification Language (SAMSON API: pagenodespecificationlanguage
  1. getNodes(selectionString: str = β€˜*’) -> samson.DataModel.DataGraph.NodeIndexer
Returns nodes (in a node indexer), based on a selectionString.
For selectionString use Node Specification Language (SAMSON API: pagenodespecificationlanguage
samson.Facade.SAMSON.getNumberOfElements() → intΒΆ

Returns the number of defined periodic table elements, including the Unknown element

samson.Facade.SAMSON.getPathFromUser(dialogTitle: str = 'Choose a path') → tupleΒΆ

Gets a path from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getPeriod(element: SBMElement::Type) → strΒΆ

Returns the period of periodic table element element

samson.Facade.SAMSON.getProxy(className: str, elementUUID: samson.Core.Container.UUID =) → samson.Core.Class.ClassProxyΒΆ

Returns the proxy of a class

samson.Facade.SAMSON.getPublicName(includeVersion: bool = False, includeHashInVersion: bool = False) → strΒΆ

Returns the β€œpublic name” of SAMSON

samson.Facade.SAMSON.getPublicVersionNumber() → strΒΆ

Returns the β€œpublic version number” of SAMSON

samson.Facade.SAMSON.getSAMSONElementsPath() → strΒΆ

Returns the path where SAMSON Elements are installed

samson.Facade.SAMSON.getSAMSONPath() → strΒΆ

Returns the path where SAMSON is installed

samson.Facade.SAMSON.getScratchPath() → strΒΆ

Returns the path to scratch data

samson.Facade.SAMSON.getSimulationFlag() → boolΒΆ

Returns true when interactive simulation is on

samson.Facade.SAMSON.getStringFromUser(dialogTitle: str = 'Set a string') → tupleΒΆ

Gets a string from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getTime() → intΒΆ

Returns SAMSON’s internal time

samson.Facade.SAMSON.getUserDataPath() → strΒΆ

Returns the path where user data is installed

samson.Facade.SAMSON.getUserPlan() → samson.Facade.SAMSON.UserPlanΒΆ

Returns the user plan

samson.Facade.SAMSON.getUserPlanString() → strΒΆ

Returns a string containing the user plan

samson.Facade.SAMSON.getVanDerWaalsAtomRadiusFlag() → boolΒΆ

Returns true when atoms are displayed with a radius proportional to their van der Waals radius

samson.Facade.SAMSON.getVanDerWaalsAtomRadiusRatio() → floatΒΆ

Returns the constant by which the atoms van der Waals radius is multiplied to represent atoms in the viewport (when a constant radius is not used)

samson.Facade.SAMSON.getVanDerWaalsRadius(element: SBMElement::Type) → samson.DataModel.Quantity.unitsSIΒΆ

Returns the van der Waals radius of periodic table element element

samson.Facade.SAMSON.getVersionNumber() → samson.Core.Container.VersionNumberΒΆ

Returns the version number of SAMSON

samson.Facade.SAMSON.getViewportHeight() → intΒΆ

Returns the viewport height

samson.Facade.SAMSON.getViewportPositionFromWorldPosition(position: samson.DataModel.Type.vector3) → samson.DataModel.Type.vector3ΒΆ

Returns the projection in the viewport of a given world position

samson.Facade.SAMSON.getViewportWidth() → intΒΆ

Returns the viewport width

samson.Facade.SAMSON.hideProgressBar() → NoneΒΆ

Hides the progress bar

samson.Facade.SAMSON.hold(node: samson.DataModel.DataGraph.Node) → NoneΒΆ

Holds a node and its descendants

samson.Facade.SAMSON.importFromFile(*args, **kwargs)ΒΆ

Overloaded function.

  1. importFromFile(fileName: str, preferredFolder: samson.DataModel.Document.Folder = None) -> None

Import a file from the disk

  1. importFromFile(fileName: str, parameters: List[str] = 0, preferredFolder: samson.DataModel.Document.Folder = None) -> None

Import a file from the disk with parameters specific to each importer

samson.Facade.SAMSON.informUser(dialogTitle: str, dialogText: str) → NoneΒΆ

Informs the user with a message in a modal pop-up dialog

samson.Facade.SAMSON.isHolding() → boolΒΆ

Returns true when SAMSON is holding

samson.Facade.SAMSON.isProgressBarStopped() → boolΒΆ

Returns true when the progress bar is stopped

samson.Facade.SAMSON.isRedoing() → boolΒΆ

Returns true while redoing

samson.Facade.SAMSON.isUndoing() → boolΒΆ

Returns true while undoing

samson.Facade.SAMSON.makeInteractionModel(dynamicalModel: SBMDynamicalModelParticleSystem, interactionModelClassName: str, interactionModelElementUUID: samson.Core.Container.UUID =) → SBMInteractionModelParticleSystemΒΆ

Make an interaction model

samson.Facade.SAMSON.makeNeigborSearch(dynamicalModel: SBMDynamicalModelParticleSystem, cutoffDistance: samson.DataModel.Quantity.unitsSI, neighborSearchClassName: str, ineighborSearchElementUUID: samson.Core.Container.UUID =) → SBSNeighborSearchParticleSystemΒΆ

Make a neighbor search algorithm

samson.Facade.SAMSON.makePropertyModel(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, propertyModelClassName: str, propertyModelElementUUID: samson.Core.Container.UUID =) → SBMPropertyModelΒΆ

Make a property model

samson.Facade.SAMSON.makeSimulator(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, interactionModelClassName: str, interactionModelElementUUID: samson.Core.Container.UUID, stateUpdaterClassName: str, stateUpdaterElementUUID: samson.Core.Container.UUID =) → SBSSimulatorParticleSystemΒΆ

Make a simulator

samson.Facade.SAMSON.makeStateUpdater(dynamicalModel: SBMDynamicalModelParticleSystem, interactionModel: SBMInteractionModelParticleSystem, stateUpdaterClassName: str, stateUpdaterElementUUID: samson.Core.Container.UUID =) → SBSStateUpdaterParticleSystemΒΆ

Make a state updater

samson.Facade.SAMSON.makeVisualModel(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, visualModelClassName: str, visualModelElementUUID: samson.Core.Container.UUID =) → SBMVisualModelΒΆ

Make a visual model

samson.Facade.SAMSON.minimize(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, maximumNumberOfSteps: int, minimumNumberOfStepsInPlateau: int, energyDifferenceCriteria: samson.DataModel.Quantity.unitsSI, printMinimizationInformationFrequency: int = 100, askUser: bool = False) → boolΒΆ

Minimize atoms in the nodeIndexer according to the provided criteria.

samson.Facade.SAMSON.printDataGraphState() → NoneΒΆ

Prints in the terminal the data graph state

samson.Facade.SAMSON.printFullMemoryUsage() → NoneΒΆ

Prints in the terminal full memory usage

samson.Facade.SAMSON.printMemoryUsage() → NoneΒΆ

Prints in the terminal memory usage

samson.Facade.SAMSON.printRendererState() → NoneΒΆ

Prints in the terminal the renderer state

samson.Facade.SAMSON.printUndoStack() → NoneΒΆ

Prints in the terminal the undo stack

samson.Facade.SAMSON.processEvents() → NoneΒΆ

Requests an update

samson.Facade.SAMSON.redo() → NoneΒΆ

Redo one command

samson.Facade.SAMSON.requestViewportUpdate() → NoneΒΆ

Requests a viewport update

samson.Facade.SAMSON.setActiveEditor(classUUID: samson.Core.Container.UUID, elementUUID: samson.Core.Container.UUID) → NoneΒΆ

Sets the current editor

samson.Facade.SAMSON.setActiveStructuralModel(arg0: SBMStructuralModel) → NoneΒΆ

Sets the active structural model

samson.Facade.SAMSON.setBusy(isBusy: bool) → NoneΒΆ

Notifies the user that SAMSON is busy

samson.Facade.SAMSON.setCurrentSelectionFilter(selectionFilterName: str) → boolΒΆ

Sets the current selection filter according to the given selection filter name. Returns true in case of the success.

samson.Facade.SAMSON.setProgressBarValue(value: int) → NoneΒΆ

Sets the value of the progress bar

samson.Facade.SAMSON.setSimulationFlag(simulationFlag: bool) → NoneΒΆ

Sets the interactive simulation flag

samson.Facade.SAMSON.setStatusMessage(message: str, time: int = 0) → NoneΒΆ

Shows a message in the status bar

samson.Facade.SAMSON.showProgressBar(name: str = '', minimum: int = 0, maximum: int = 0, minimumDurationInSeconds: float = 2.0, isCancellable: bool = True, cancelButtonText: str = 'Cancel') → NoneΒΆ

Shows the progress bar

samson.Facade.SAMSON.showProperties(node: samson.DataModel.DataGraph.Node) → boolΒΆ

Shows the properties widget of a node

samson.Facade.SAMSON.snap(*args, **kwargs)ΒΆ

Overloaded function.

  1. snap(x: int, y: int) -> List[int]

Returns the snapped mouse viewport displacement (x, y)

  1. snap(x: int, y: int, pointInPlane: samson.DataModel.Type.vector3) -> List[int]

Returns the snapped mouse viewport displacement (x, y) in the plane containing pointInPlane

  1. snap(displacement: samson.DataModel.Quantity.unitsSI) -> samson.DataModel.Quantity.unitsSI

Returns the snapped translational (if the provided displacement is in length units) or angular (if the provided displacement is in dimensionless units) displacement if the snapping of translational/angular displacements is on, else it returns the unchanged displacement

  1. snap(displacement: samson.DataModel.Type.vector3) -> samson.DataModel.Type.vector3

Returns the snapped displacement if the snapping of translational displacements is on, else it returns the unchanged displacement

  1. snap(rotationMatrix: samson.DataModel.Type.matrix33) -> samson.DataModel.Type.matrix33

Returns the snapped rotation matrix if the snapping of angular displacements is on, else it returns the unchanged rotationMatrix

  1. snap(transform: samson.DataModel.Type.spatialTransform) -> samson.DataModel.Type.spatialTransform

Returns the snapped spatial transform according to the translational and angular snapping parameters

samson.Facade.SAMSON.startSimulation() → NoneΒΆ

Starts interactive simulation

samson.Facade.SAMSON.startTimer() → NoneΒΆ

Starts a new performance timer

samson.Facade.SAMSON.stopSimulation() → NoneΒΆ

Stops interactive simulation

samson.Facade.SAMSON.stopTimer() → List[samson.DataModel.Quantity.unitsSI]ΒΆ

Stops the top performance timer. Returns elapsed time and total time [in seconds]

samson.Facade.SAMSON.toggleSimulation() → NoneΒΆ

Toggles interactive simulation on and off

samson.Facade.SAMSON.undo() → NoneΒΆ

Undo one command