Skip to content

Create An Icon for A Node

Ian Keough edited this page Jul 21, 2015 · 1 revision

Generate icon name?

Some cases:

  • General: Namespace.Class.MethodName.Small.png

e.g. DSCore.Color.ByARGB.Small.png

  • NodeSearchElement (from folder Dynamo\bin\AnyCPU\Debug\nodes): Namespace.Class.Small.png

e.g. DSIronPythonNode.PythonNode.Small.png

  • Builtin: Method.Small.png

e.g. AllFalse.Small.png

  • Operators use not theirs' real name, because it can be like % or !=, so VS doesn't allow such names. Operators use FunctionDescriptor.Name.Small.png

e.g. add.Small.png

  • Overloaded methods: Namespace.Class.MethodName.1st_par_type-2nd_par_type.Small.png

e.g.

Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin.Point.Small.png Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin.double-double.Small.png

Load icon?

Consider the example of loading icon for category Core, class View, method Watch3D.

  1. Run Dynamo to ensure from which project came node.

  2. Copy its' full name.

image

  1. Go to Object Browser and find project, that creates this node.

Note: that is only needed to find out name of project, that creates this node.

image

  1. Go to src\Resources\

  2. Find folder with your Project (if it's not presented create it).

Note: name of folder is equal to . resx file, so it's easy to find appropriate file of resources.

image

  1. Go to folder SmallIcons

image

  1. Rename icon like Namespace.Class.Method.Small.png (e.g. Dynamo.Nodes.Watch3D.Small.png)

image

If method is overloaded e.g. Method(int a); Method(int a, double b) then like that Namespace.Class.Method.int .Small.png Namespace.Class.Method.int-double.Small.png

  1. Add to git like: $ git add C:/../Dynamo/src/Resources/\*.png

  2. Open Project DynamoIcons. image

  3. Choose appropriate file of resources and open it.

image

  1. Drag and drop your image here.

image

  1. Got to properties and change Persistence from "Linked at compile time" to "Embedded in .resx".

image

  1. Delete Resource folder.

image

  1. Rebuild DynamoIcons.

image

  1. Run Dynamo.

NB – Long namespaces!

If you try to load node for another assembly, pay attention to its' namespace.

E.g. Category Geometry, Class Arc, Method ByBestFitThroughPoints.

image

image

Namespace is quite long. So, right name for icon will be:

Autodesk.DesignScript.Geometry.Arc.ByBestFitThroughPoints.Small.png

NB – Overridden methods!

image

Overridden methods have at the right side incoming parameters.

Name icons in this way:

Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin.Point.Small.png

Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin.double-double.Small.png

Autodesk.DesignScript.Geometry.CoordinateSystem.ByOrigin.double-double-double.Small.png

If you have array in incoming parameters,like that one:

image

Use instead of [] - 1, [][] - 2, etc.

E.g.

Autodesk.DesignScript.Geometry.BoundingBox.ByGeometry.Geometry.SmallIcon.png

Autodesk.DesignScript.Geometry.BoundingBox.ByGeometry.Geometry1.SmallIcon.png

NB – icons for tooltip!

All the above is also suitable for tooltip's icon, except you should change SmallIcon to LargeIcon everywhere.

More examples:

Geometry.Point

Operators

Revit.

Clone this wiki locally