Skip to content

API Changes in Dynamo 2.0

Martin Misol Monzo edited this page Jun 9, 2020 · 2 revisions

This document details changes to the Dynamo API done in the 2.0 release.

DynamoPackagesWpf

DynamoPackagesWpf.dll is added to Dynamo 2.0 to facilitate view extensions.

DesignscriptBuiltin

DesignscriptBuiltin.dll is added to Dynamo 2.0 and contains Dictionary methods.

ProtoCore

  • VisitIdentifierNode(), VisitIdentifierListNode() new returns bool.

Dynamo Core

Dynamo.Configuration

  • IsBackgroundPreviewActive in PreferenceSettings.cs is obsolete now. Please use BackgroundPreviews.
  • IPreviewBubblePreference is removed.
  • IBackGroundPreviewPreference is removed.
  • BackgroundPreviews is added to IPreferences interface.
  • ShowPreviewBubbles is added to IPreferences interface.
  • GetIsBackGroundPreviewActive(string) is added to IPreferences interface.

Dynamo.Search

  • CreationName property added to CustomNodeSearchElement.cs. This returns a name using which this node can be created
  • FullName property in NodeSearchElement.cs is virtual property now.

Dynamo.Library

  • DefaultValueString property added to TypedParameter.cs. Use this to get string representation of AST node
  • Dynamo.Library.TypedParameter.ToCommentNameString replaces ToNameString.
  • Dynamo.Library.TypedParameter constructor is changed to take an optional summary string.

Dynamo.Models

  • NodeCommands.ValidateConnectionsCommand has been removed.
  • DynamoModel.DynamoReady event is added.
  • DynamoPreferencesData class is added to DynamoModel.cs. This class contains the extra Dynamo-specific preferences data
  • RequestWorkspaceBackUpSave event added to DynamoModel.cs. This event occurs when a workspace is scheduled to be saved to a backup file
  • WorkspaceOpening event in DynamoModel.cs takes object instead of XMLElement.
  • HostVersion and HostName properties added to DynamoModel.cs.

Dynamo.Core

  • PythonTemplateFilePath property is added to PathManager.cs
  • CustomNodeManager(..) has LibraryServices libraryServices as an option. ex: CustomNodeManager(NodeFactory nodeFactory, MigrationManager migrationManager, LibraryServices libraryServices)
  • TryGetCustomNodeData(..), CreateCustomNodeInstance(..) are added to CustomNodeManager.cs

Dynamo.Migration

  • The property NodeMigrationAttribute.To has been removed.
  • The property NodeMigrationAttribute.From has been renamed to NodeMigrationAttribute.Version.

Dynamo.Extensions

  • ExtensionLoader.ExtensionLoading event was added.
  • Dynamo.Extensions.IExtensionSource was added - this interface backs objects which can load other extensions.
  • Dynamo.Extensions.ReadyParams.StartupParams was added.
  • ExtensionManager class has new methods - RegisterService(), UnregisterService(), GetService(..)

Dynamo.Engine

  • The LibraryServices.GetFunctionDescriptor method has been made public.
  • CompilationServices(..) takes LibraryServices instead of ProtoCore.Core.
  • IsLacingDisabled property added to FunctionDescriptor.cs.
  • GetFunctionDescriptor(.. is added to LibraryServices.cs.
  • GetPriorNames() added to LibraryServices.cs. This returns a dictionary of old names vs. new names for node migration
  • GetAllFunctionDescriptors() added to LibraryServices.cs. This returns a list of function descriptors associated with the function name.

Dynamo.Graph

  • Dynamo.Graph.SaveContext.None was added.
  • UndoRedoRecorder.RecordModelAsOffTrack(Guid) was removed.

  • Workspace:

  • X and Y, Zoom, Height, Width on WorkspaceModel have been made obsolete and should be retrieved via the WorkspaceViewModel instead as these are view properties.

  • X and Y and Zoom on NodeModel have been made obsolete and should be retrieved via the NodeViewModel instead as these are view properties.

  • CanUndo and CanRedo removed from WorkspaceModel.cs

  • The DynamoModel.AddWorkspace method has been made public.

  • A new constructor was added for WorkspaceInfo to facilitate deserialization.

  • A new constructor is added for HomeWorkspaceModel to facilitate deserialization.

  • The DSFunction.FunctionName property is added to facilitate serialization.

  • The VariableInputNode.VariableInputPorts property is added to facilitate serialization.

  • Converter classes are added to support serialization and deserialization.

  • Some method parameters have changed names to align with the properties which they set internally. This facilitates deserialization.

  • The Function.IsCustomNode and Function.FunctionUuid properties have been added to facilitate serialization.

  • WorkspaceModel.save now returns void.

  • constructor HomeWorkspaceModel(...) added to HomeWorkspaceModel.cs

  • SerializationExtensions.cs class is added to facilitate serializing a WorkspaceModel to json

  • UndoRedo.cs class is added to WorkspaceModel.

  • WorkspaceInfo(..) constructor added to WorkspaceInfo.cs.

  • ScaleFactor property added to WorkspaceInfo.cs.

  • ExtraWorkspaceViewInfo , ExtraNodeViewInfo ExtraNoteViewInfo , ExtraAnnotationViewInfo class added to WorkspaceModel.cs. This is a Non view-specific container for additional view information required to fully construct a WorkspaceModel from JSON

  • Dependencies property is added to WorkspaceModel.cs. This gathers the direct workspace dependencies of this workspace

  • Annotations is obsolete in WorkspaceModel.cs. please use Annotations on the WorkspaceViewModel.

  • FromJson(...) added to WorkspaceModel.cs. This loads a WorkspaceModel from json

  • UpdateWithExtraWorkspaceViewInfo(..) method added to WorkspaceModel.cs. This Updates a workspace model with extra view information

  • DeleteModel(..), CreateModel(..), ReloadModel(..), GetModelForElement(..) GetModelInternal(..) methods removed from `WorkspaceModel.cs.

  • SerializationExtensions class has been added to provide the WorkspaceModel.ToJson(...) extension method

  • DynamoModel.SaveWorkspace is removed. Use WorkspaceModel.Save instead.

  • WorkspaceModel.WorkspaceSaved event is now WorkspaceModel.Saved

NodeModel:


  • NodeModel.HasInput(...) has been removed. Use PortModel.IsConnected instead.

  • NodeModel.ValidateConnections() has been removed.

  • NodeModel.RegisterInputPorts() is now NodeModel.RegisterInputPorts(IEnumerable<PortData> portDatas). But NodeModel.RegisterInputPorts is deprecated. Please use the InPortNamesAttribute, InPortDescriptionsAttribute, and InPortTypesAttribute instead.

  • NodeModel.RegisterOutputPorts() is now NodeModel.RegisterOutputPorts(IEnumerable<PortData> portDatas). But NodeModel.RegisterOutputPorts() is deprecated. Please use the OutPortNamesAttribute, OutPortDescriptionsAttribute, and OutPortTypesAttribute instead.

  • NodeModel.AddPort(...) has been removed. Ports can now be added using NodeModel.InPorts.Add(...) and NodeModel.OutPorts.Add(...)

  • The PortModel.Data property has been removed.

  • The PortModel.ToolTipContent property is now PortModel.ToolTip.

  • PortModel.DefaultValueEnabled has been removed. Please use PortModel.DefaultValue == null to check whether a port has a default value.

  • NodeInputData.cs class is added to Nodes.

  • NodeOutputData.cs class is added to Nodes.

  • NodeOutPutTypes enum is added for supported output data types.

  • Statement.GetDefinedVariableNames has a boolean parameter removed.

  • Variable.NameWithIndex was added.

  • IsUpstreamVisible, OverrideNameWithNickName are removed from NodeModel.cs. DictionaryLink property added to NodeModel.cs.

  • SetNickNameFromAttribute() changed to SetNameFromNodeNameAttribute() in NodeModel.cs.

  • ClearRuntimeError() changed to ClearErrorsAndWarnings() in NodeModel.cs.

  • ValidateConnections() is removed from NodeModel.cs.

  • PortName property is now Name property in PortModel.cs.

  • ToolTipContent property is now ToolTip in PortModel.cs.

  • ShouldKeepListStructure is now KeepListStructure in PortModel.cs.

  • IsOutPutNode and IsSetAsOutput are added to NodeModel

  • OutputData is added to NodeModel

Other Models:


  • Many properties now include attributes from Json.net.

  • AnnotationModel has been made Obsolete should be retrieved via the WorkspaceViewModel instead.

  • AnnotationModel.SelectedModels is changed to AnnotationModel.Nodes

  • PresetModel has been made obsolete.

  • TextMaxWidth property is added to AnnotationModel.cs

  • ConnectorModel(PortModel start, PortModel end, Guid guid) constructor is added to ConnectorModel.cs.

  • ShouldSerializeX() and ShouldSerializeY() added to ModelBase.cs. Guid property in ModelBase.cs is now virtual.

  • UpdatePortsForUnresolved(..) method added to Function.cs. constructor Symbol(IEnumerable<PortModel> inPorts, IEnumerable<PortModel> outPorts, TypedParameter parameter) and Output(IEnumerable<PortModel> inPorts, IEnumerable<PortModel> outPorts) added to Function.cs

  • constructor DummyNode(..) added to DummyNode.cs. This function creates DummyNode with specified number of ports

  • OriginalNodeContent in DummyNode.cs returns object instead of XMLElement.

  • NickName is changed to Name in FunctionCallNodeController.cs.

  • FunctionSignature property is added to DSFunction.cs and DSVarArgFunction.cs. Also, DSVarArgFunction.cs has FunctionType property added.

  • LayoutExtensions.cs class is added to Workspaces. This contains methods for organizing graphs.

  • NodeReadConverter, WorkspaceReadConverter, WorkspaceWriteConverter, DummyNodeWriteConverter, ConnectorConverter, IdToGuidConverter, TypedParameterConverter , IdReferenceResolver are added to the new class SerializationConverters.cs.

  • CodeBlockNodeModel.TempVariables and IsTempIdentifer are removed.

  • CodeBlockNodeModel.LoadAndCreateConnectors signature has changed to accept a SaveContext parameter.

  • Dynamo.Updates.IHostManager folded into IUpdateManager.

DynamoCoreWPF

  • DynamoView.LibraryCollapsed is added.

  • DynamoView.GetUniqueAddOnCategories is added.

  • ShowHideConsoleMenuConverter is removed.

  • SHowHidePreviewBubblesConverter is removed.

  • DefaultWatchHandler.Process and ProcessThing now accept a new parameter - a preferred Dictionary ordering of keys names.

  • IWatchHandler interface is updated with new process signature.

  • GenerateWatchViewModelForData() is updated with new signature accepting preferred ordering of keys.

  • WatchHandlerCallback invoke and beginInvoke updated with new signature accepting preferred ordering of keys.

  • DynamoViewModel.TogglePreviewBubbleShowingCommand is removed.

  • NodeViewModel.IsOuput is added.

  • NodeViewModel.IsSetAsOutput is added.

  • Dynamo.Wpf.Extensions.IViewExtensionSource is added.

  • Dynamo.Wpf.Extensions.ViewExtensionLoader.ExtensionLoading event is added.

  • Dynamo.wpf.Extensions.ViewLoadedParams.ViewStartupParams is added.

  • Dynamo.Wpf.ViewModels.Watch3d.CameraData.Equals is added.

  • Dynamo.Wpf.ViewModesl.Watch3d.IWatchPreferenceProperties folded into Dynamo.Wpf.ViewModels.Watch3d.IWatch3dViewModel.PreferenceWatchName.

Workspaces

  • The Workspaces assembly is added with methods for serializing and deserializing WorkspaceModel objects to json.

Libraries

CoreNodeModels

  • Public default constructors have been added for CombinatorNode types to facilitate serialization.

CoreNodeModelsWpf

  • All classes in CoreNodeModelsWpf in Dynamo.Wpf moved to CoreNodeModelsWpf namespace
    • The Dynamo.Wpf namespace has been removed to CoreNodeModelsWpf
      • Dynamo.Wpf.DoubleSliderSettingsControl is now CoreNodeModelsWpf.DoubleSliderSettingsControl
      • Dynamo.Wpf.ElementSelectionControl is now CoreNodeModelsWpf.ElementSelectionControl
      • Dynamo.Wpf.IntegerSliderSettingsControl is now CoreNodeModelsWpf.IntegerSliderSettingsControl
      • Dynamo.Wpf.ConverterViewModel is now CoreNodeModelsWpf.ConverterViewModel
      • Dynamo.Wpf.SliderViewModel<T> is now CoreNodeModelsWpf.SliderViewModel<T>
    • The Dynamo.Wpf.Controls namespace has been removed to CoreNodeModelsWpf.Controls
      • Dynamo.Wpf.Controls.DateTimeInputControl is now CoreNodeModelsWpf.Controls.DateTimeInputControl
      • Dynamo.Wpf.Controls.DynamoConverterControl is now CoreNodeModelsWpf.Controls.DynamoConverterControl
      • Dynamo.Wpf.Controls.DynamoSlider is now CoreNodeModelsWpf.Controls.DynamoSlider
    • The Dynamo.Wpf.Converters namespace has been removed to CoreNodeModelsWpf.Converters
      • Dynamo.Wpf.Converters.SelectionButtonContentConverter is now CoreNodeModelsWpf.SelectionButtonContentConverter
      • Dynamo.Wpf.Converters.StringToDateTimeConverter is now CoreNodeModelsWpf.Converters.StringToDateTimeConverter
    • The Dynamo.Wpf.Nodes namespace has been removed to CoreNodeModelsWpf.Nodes
      • Dynamo.Wpf.Nodes.BoolSelectorNodeViewCustomization is now CoreNodeModelsWpf.Nodes.BoolSelectorNodeViewCustomization
      • Dynamo.Wpf.Nodes.ColorRangeNodeViewCustomization is now CoreNodeModelsWpf.Nodes.ColorRangeNodeViewCustomization
      • Dynamo.Wpf.Nodes.CreateListNodeViewCustomization is now CoreNodeModelsWpf.Nodes.CreateListNodeViewCustomization
      • Dynamo.Wpf.Nodes.DirectoryNodeViewCustomization is now CoreNodeModelsWpf.Nodes.DirectoryNodeViewCustomization
      • Dynamo.Wpf.Nodes.DoubleInputNodeViewCustomization is now CoreNodeModelsWpf.Nodes.DoubleInputNodeViewCustomization
      • Dynamo.Wpf.Nodes.DropDownNodeViewCustomization is now CoreNodeModelsWpf.Nodes.DropDownNodeViewCustomization
      • Dynamo.Wpf.Nodes.DummyNodeNodeViewCustomization is now CoreNodeModelsWpf.Nodes.DummyNodeNodeViewCustomization
      • Dynamo.Wpf.Nodes.FormulaNodeViewCustomization is now CoreNodeModelsWpf.Nodes.FormulaNodeViewCustomization
      • Dynamo.Wpf.Nodes.SelectionBaseNodeViewCustomization is now CoreNodeModelsWpf.Nodes.SelectionBaseNodeViewCustomization
      • Dynamo.Wpf.Nodes.StringInputNodeViewCustomization is now CoreNodeModelsWpf.Nodes.StringInputNodeViewCustomization
      • Dynamo.Wpf.Nodes.WatchNodeViewCustomization is now CoreNodeModelsWpf.Nodes.WatchNodeViewCustomization
      • Dynamo.Wpf.Nodes.WatchImageNodeViewCustomization is now CoreNodeModelsWpf.Nodes.WatchImageNodeViewCustomization
    • The Dynamo.Wpf.NodeViewCustomizations namespace has been removed to CoreNodeModelsWpf.NodeViewCustomizations
      • Dynamo.Wpf.NodeViewCustomizations.ConverterNodeViewCustomization is now CoreNodeModelsWpf.NodeViewCustomizations.ConverterNodeViewCustomization
      • Dynamo.Wpf.NodeViewCustomizations.DateTimeNodeViewCustomization is now CoreNodeModelsWpf.NodeViewCustomizations.DateTimeNodeViewCustomization
      • Dynamo.Wpf.NodeViewCustomizations.DoubleSliderNodeViewCustomization is now CoreNodeModelsWpf.NodeViewCustomizations.DoubleSliderNodeViewCustomization
      • Dynamo.Wpf.NodeViewCustomizations.IntegerSliderNodeViewCustomization is now CoreNodeModelsWpf.NodeViewCustomizations.IntegerSliderNodeViewCustomization

Python

  • PythonNodeModelsWpf.ScriptEditorWindow now requires three arguments

UnitsUI

  • Public constructors have been added to MeasurementInputBase to facilitate serialization.

Releases

Roadmap

How To

Dynamo Internals

Contributing

Python3 Upgrade Work

Libraries

FAQs

API and Dynamo Nodes

Clone this wiki locally