Create Icons for custom package


#1

Hello to all,
I am trying to create custom icons for nodes to upload with a package. Any suggestions? I already tried to use GitHub suggestions but with no rsults. I have a System.Drawing.dll ERROR.
Is there someone that could share with me his project folder? with a correct csproj version?
Or maybe a System.Drawing.dll that works :slight_smile:
Many thanks in advance!
Elisabetta


#2

Hi @Elisabetta_Caterina! I assume you mean this Dynamo wiki page. I don’t remember having any issue with any library, only make sure you follow all steps and have extra care when editing the “AfterBuild” text on the csproj file.

I have the JsonData package published on GitHub with custom icons implemented. Hope it helps as reference!


#3

Many thanks, actually i don’t have anything on the “AfterBuild” part of the code.
I added but nothing change at all :frowning:


#4

This will also work. I use this method in my package… the important thing here is that it use .net 2.0, and that includes installing .net 3.5 on windows 10 computers!

  <Target Name="BeforeBuild">
    <GetReferenceAssemblyPaths TargetFrameworkMoniker=".NETFramework, Version=v2.0">
      <Output TaskParameter="FullFrameworkReferenceAssemblyPaths" PropertyName="FrameworkAssembliesPath" />
    </GetReferenceAssemblyPaths>
    <GenerateResource UseSourcePath="true" Sources="$(ProjectDir)PackageImages.resx" OutputResources="$(ProjectDir)PackageImages.resources" References="$(FrameworkAssembliesPath)System.Drawing.dll" />
    <AL TargetType="library" EmbedResources="$(ProjectDir)PackageImages.resources" OutputAssembly="$(OutDir)Package.customization.dll" />
  </Target>

#5

@alvpickmans i also notice a difference on procedures. I am not using a Zero Touch Assembly or NodeModel assembly(i don’t know).
What i was trying to do was this https://github.com/DynamoDS/Dynamo/wiki/Creating-Icons-for-Custom-Nodes
but i still not able to do it.
I mean i can have a .dll but actually no preview is available.

I published the VRIM package on GitHub and i really don’t understand what’s wrong.

I also notice a thing on your nodes
test
how did you do it??
Thank you!
Elisabetta


#6

The icons you ask for is stated in the first line of a node
add .Query or .Actions or .Create

example:
Category="DanEDU.Revit.Query"
Category="DanEDU.Revit.Actions"
Category=“DanEDU.Revit.Create”

<Workspace Version="1.3.0.875" X="0" Y="0" zoom="1" ScaleFactor="1" Name="Family.AddSharedParameter|DanEDU" Description="Add shared parameter by name in a family document. Please note that a default shared parameter file must be set in Revit" ID="ad7d8df4-37c3-4a7d-ae5e-96fbcb44febb" Category="DanEDU.Revit.Create">


#7

many thanks @erfajo !! It is the same i have! But still not working :frowning:
I tried many times with no result.
Can i ask you which System.Drawing version and System.Windows.Forms did you use to build in the .resx?
And also, did you change the PackageImages “name” with your “package” name? or you left them default as the script you send me?
And another question
did you use the ID=“4cdf5500-fe21-402e-acb7-bb9fc1b5a64b” or the SampleLibraryZeroTouch.Examples.PeriodicUpdateExample.PointField.Small.png to encode images?

Thank you!!


#8

mine looks like this, as you can see my system.drawing is 4.0.30319

I didnt use the SampleLibraryZeroTouch.Examples, I build my own C# project from scratch

My newest project is using .net 4.6, which is going to be a full zerotouch package.


#9

Thank you! Probably my problem is the system.drawing
because i can’t understand why is not working.
best


#10

@Elisabetta_Caterina because you are using .dyf files you should use the ID of the custom node as the name of the entry in the customization dll, it looks like you are using the function name- which is how it is done for zero touch nodes.


#11

Ok finally i understand. I needed to call the Customization.dll as Package.Customization.dll and not with my definition name.
Many Thanks
I got it!!! :slight_smile:
Elisabetta