![]() |
VOOZH | about |
dotnet add package ArchiToolkit.Grasshopper --version 2025.9.21
NuGet\Install-Package ArchiToolkit.Grasshopper -Version 2025.9.21
<PackageReference Include="ArchiToolkit.Grasshopper" Version="2025.9.21" />
<PackageVersion Include="ArchiToolkit.Grasshopper" Version="2025.9.21" />Directory.Packages.props
<PackageReference Include="ArchiToolkit.Grasshopper" />Project file
paket add ArchiToolkit.Grasshopper --version 2025.9.21
#r "nuget: ArchiToolkit.Grasshopper, 2025.9.21"
#:package ArchiToolkit.Grasshopper@2025.9.21
#addin nuget:?package=ArchiToolkit.Grasshopper&version=2025.9.21Install as a Cake Addin
#tool nuget:?package=ArchiToolkit.Grasshopper&version=2025.9.21Install as a Cake Tool
This is designed for simplify your way of developing plugins in Grasshopper. It is more clean and efficient compared to SimpleGrasshopper. So almost all features are similar to SimpleGrasshopper.
This tool is using Roslyn to help you coding when you are coding.
Install the ArchiToolkit.Grasshopper and then make sure that your LangVersion is latest. At the moment, my Visual
Studio is at the version 17.13.4.
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ArchiToolkit.Grasshopper" Version="0.9.13" PrivateAssets="all" />
</ItemGroup>
All the components are methods. to simplify creating these things, a static method is a component!
To let it know which method should be the component, please tag it with DocObjAttribute.
public class Test
{
[DocObj]
public static int Add(int x, int y) => x + y;
}
Now, you'll see a component in GH!
The parameters can be in, out, or ref
Please notice that, the Source generator will automatically generate the ArchiToolkit.Resources.resx file and the
icons.png located in Icons Folder. Here are the structure.
In ArchiToolkit.Resources.resx, you can't modify it! but you can add your own languages to it, so it is how we do
with l10n.
You can't modify the pngs when your IDE is open, so please turn your IDE off when you want to modify the png. And the png is the icons in the grasshopper.
This is the general infos that almost all items can be used with.
You can add the attribute CategoryAttirbute and SubcategoryAttribute to control them.
Only the closest attribute to the DocObj will affect.
[Category("MyCategory")]
public class Test
{
[Subcategory("SubCate")]
[DocObj]
public static int Add(int x, int y) => x + y;
}
For adding the name or nickname or description on the Document object, you can add the attribute ObjNamesAttribute.
public class Test
{
[ObjNames("Addition", "Add", "Normal adding")]
[DocObj]
[return: ObjNames("Result", "r", "Description of the result.")]
public static int Add(
[ObjNames("X", "x", "Description of x")]int
x, int y) => x + y;
}
For changing the Exposure, please add the ExposureAttribute on it.
public class Test
{
[Exposure(GH_Exposure.secondary)]
[DocObj]
public static int Add(int x, int y) => x + y;
}
If you want to set the category's Short Name or Symbol name, pelase use the attribute CategoryInfoAttribute on the
assembly.
[assembly: CategoryInfo(null, "Short Name", 'S')]
Of course, ObsoleteAttribute can be used on.
public class Test
{
[Obsolete]
[DocObj]
public static int Add(int x, int y) => x + y;
}
You can add your custom attributes on your object by using ObjAttrAttribute<>.
file class MyAttribute(IGH_Component component)
: GH_ComponentAttributes(component);
public class Test
{
[ObjAttr<MyAttribute>]
[DocObj]
public static int Add(int x, int y) => x + y;
}
You can set the custom ComponentGuid by using the attribute ObjGuidAttribute.
public class Test
{
[ObjGuid("71156816-F2C5-46B0-B6D9-E71F28CDF7A4")]
[DocObj]
public static int Add(int x, int y) => x + y;
}
For some cases, you may want to add more information for this component.
If you want to add your own base component, do it with BaseComponentAttribute<>.
file abstract class MyComponent(string name, string nickname, string description, string category, string subCategory)
: GH_Component(name, nickname, description, category, subCategory)
{
}
public class Test
{
[BaseComponent<MyComponent>]
[DocObj]
public static int Add(int x, int y) => x + y;
}
If you want to create a Task Capable Component, please make your method return a Task or ValueTask or your custom awaitable things.
public class Test
{
[DocObj]
public static Task<int> AddAsync(int x, int y) => Task.FromResult(x + y);
}
It needs to create the record. So you may need the package PolySharp or you need to add these codes below to your project
namespace System.Runtime.CompilerServices
{
internal static class IsExternalInit;
}
If you want to make an IGH_UpgradeObject to update your component, add the attribute UpgradeToAttribute or
UpgradeFromAttribute to
make it.
public class Test
{
[UpgradeTo<Component_Add>(2025, 3, 26)]
[DocObj]
public static int OldAdd(int x, int y) => x + y;
[DocObj]
public static int Add(int x, int y) => x + y;
}
public class Test
{
[UpgradeFrom("498A54B0-DA31-4C9F-905D-6FEA011DBFD5", 2025, 3, 26)]
[DocObj]
public static int Add(int x, int y) => x + y;
}
This is for the parameters info, so you can add your own things.
You can get the IGH_DataAccess or IGH_Component just by adding it into your parameters
public class Test
{
[DocObj]
public static int Add(IGH_DataAccess access, IGH_Component component, int x, int y) => x + y;
}
You can specify the parameter type by using the attribute ParamTypeAttribute.
You can specify the type or the guid. But it is better to do it with type by the generic one.
public class Test
{
[DocObj]
public static int Add([ParamType<Param_Integer>]int x, [ParamType("{2E3AB970-8545-46bb-836C-1C11E5610BCE}")]int y) => x + y;
}
For the persistent data, you need to add the attribute PersistentDataAttribute on the parameter.
public class Others
{
internal static int yDefault = 1;
}
public class Test
{
internal static int xDefault = 0;
[DocObj]
public static int Add(
[PersistentData(nameof(xDefault))]int x,
[PersistentData<Others>(nameof(Others.yDefault))] int y)
=> x + y;
}
Or you can just make a default value.
public class Test
{
[DocObj]
public static int Add(int x, int y = 10) => x + y;
}
Optional the data by the attribute OptionalAttribute.
public class Test
{
[DocObj]
public static int Add(int x, [Optional]int y) => x + y;
}
If you wanna your geometry is hidden, just add HiddenAttribute on it.
public class Test
{
public static int Add([Hidden]Arc arc, int y) => (int)arc.Radius + y;
}
for the Data access, List<> means list access, GH_Structure<> means tree access. Io is a special type which can get the Index, HasGot and the Value.
public class Test
{
[DocObj]
public static int Add(Io<List<int>> x, int y) => x.Index + y;
}
For the case that you want to add the parameter with tags, you can add the attribute ParamTagAttribute.
public class Test
{
[DocObj]
public static int Add([ParamTag(ParamTagType.Principal | ParamTagType.Flatten)]int x, int y)=> x + y;
}
For the case you want the parameter is a field in the component, you can use the attribute ObjFieldAttribute.
You can also change the config about should it saveToFile.
public class Test
{
[DocObj]
public static int Add([ObjField(true)]int x, int y)=> x + y;
}
You can also add DocObjAttribute on the type to create a new parameter.
[DocObj]
public class MyType;
You can specify the Goo type by using BaseGooAttribute.
Just notice that don't forget to using partial key word to implement your type.
[BaseGoo<GH_GeometricGoo<MyType>>]
[DocObj]
public class MyType;
partial class Param_MyType
{
partial class Goo
{
public override IGH_GeometricGoo DuplicateGeometry()
{
throw new NotImplementedException();
}
public override BoundingBox GetBoundingBox(Transform xform)
{
throw new NotImplementedException();
}
public override IGH_GeometricGoo Transform(Transform xform)
{
throw new NotImplementedException();
}
public override IGH_GeometricGoo Morph(SpaceMorph xmorph)
{
throw new NotImplementedException();
}
public override BoundingBox Boundingbox => default;
}
}
To Add your own type name and type description, you can add the attribute TypeDescAttribute.
[TypeDesc("Type Name", "Type Description")]
[DocObj]
public class MyType;
For the case you want to generate the parameters from other libraries, you can use the attribute DocObj on the
assembly to do this.
[assembly: DocObj<RemoteType>]
public class RemoteType;
If you want your param can be previewed or can be baked, just let your class or struct implement the interface
IGH_PreviewData or IGH_BakeAwareData.
[DocObj]
public class MyType : IGH_PreviewData, IGH_BakeAwareData
{
public void DrawViewportWires(GH_PreviewWireArgs args)
{
}
public void DrawViewportMeshes(GH_PreviewMeshArgs args)
{
}
public BoundingBox ClippingBox => BoundingBox.Unset;
public bool BakeGeometry(RhinoDoc doc, ObjectAttributes att, out Guid obj_guid)
{
obj_guid = Guid.Empty;
return false;
}
}
For the case you want to use the ArchiToolkit.Resources. You can do this to let it generate the string for you.
"Localization String".Loc("Optional Key");
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Framework | net48 net48 is compatible. net481 net481 was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2025.9.21 | 286 | 9/21/2025 |
| 2025.9.20 | 234 | 9/20/2025 |
| 0.9.16.23 | 357 | 9/17/2025 |
| 0.9.16.22 | 266 | 9/15/2025 |
| 0.9.16.21 | 270 | 9/15/2025 |
| 0.9.16.20 | 186 | 9/12/2025 |
| 0.9.16.19 | 211 | 9/8/2025 |
| 0.9.16.18 | 213 | 9/5/2025 |
| 0.9.16.17 | 248 | 9/1/2025 |
| 0.9.16.16 | 273 | 8/27/2025 |
| 0.9.16.15 | 222 | 8/20/2025 |
| 0.9.16.14 | 310 | 8/7/2025 |
| 0.9.16.13 | 392 | 7/21/2025 |
| 0.9.16.12 | 212 | 7/10/2025 |
| 0.9.16.11 | 148 | 7/5/2025 |
| 0.9.16.10 | 187 | 6/28/2025 |
| 0.9.16.9 | 190 | 6/27/2025 |
| 0.9.16.8 | 214 | 6/23/2025 |
| 0.9.16.7 | 224 | 6/17/2025 |
| 0.9.16.6 | 371 | 6/12/2025 |