-
Notifications
You must be signed in to change notification settings - Fork 10
Create An Icon for A Node
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
Consider the example of loading icon for category Core, class View, method Watch3D.
-
Run Dynamo to ensure from which project came node.
-
Copy its' full name.
- 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.
-
Go to src\Resources\
-
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.
- Go to folder SmallIcons
- Rename icon like Namespace.Class.Method.Small.png (e.g. Dynamo.Nodes.Watch3D.Small.png)
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
-
Add to git like:
$ git add C:/../Dynamo/src/Resources/\*.png
-
Open Project DynamoIcons.
-
Choose appropriate file of resources and open it.
- Drag and drop your image here.
- Got to properties and change Persistence from "Linked at compile time" to "Embedded in .resx".
- Delete Resource folder.
- Rebuild DynamoIcons.
- Run Dynamo.
If you try to load node for another assembly, pay attention to its' namespace.
E.g. Category Geometry, Class Arc, Method ByBestFitThroughPoints.
Namespace is quite long. So, right name for icon will be:
Autodesk.DesignScript.Geometry.Arc.ByBestFitThroughPoints.Small.png
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:
Use instead of [] - 1, [][] - 2, etc.
E.g.
Autodesk.DesignScript.Geometry.BoundingBox.ByGeometry.Geometry.SmallIcon.png
Autodesk.DesignScript.Geometry.BoundingBox.ByGeometry.Geometry1.SmallIcon.png
All the above is also suitable for tooltip's icon, except you should change SmallIcon to LargeIcon everywhere.
Revit.