我们来自江河梦小组(Scond Effect Group),工程用到gh,所以必须学习好GH插件,而大部分权威资料都来自国外,所以就组织组员翻译来自GH官方论坛的帖子,以便学习。下面是一篇David的帖子讲解有关GH开启屏面板的开发及应用,由林振华同学翻译。
Adding GHAlibrary icons to the Grasshopper banner
将GHA程序库的目录图标添加到GH横幅中
- Posted by David Rutten on October 2, 2010 at 12:46pm in VB, C# and Python Coding
- 由David Rutten于2010年10月2日下午12:46在VB,C#和Python Coding中发布
· Send MessageView Discussions
Dear GHA developers,
亲爱的GHA 开发者们
as you may have noticed, Grasshopper 0.7 now support loaded library iconson the banner:
或许正如你所注意到的,GH0.7现在已经支持加载程序库中的图标横幅了(支持将图标加载到声明面板上)
In order to haveyour GHA library participate with this, you must declare a public class in yourproject (make sure you supply a constructorwith no arguments!) of type Grasshopper.Kernel.GH_AssemblyInfo
为了你的GHA 程序库参与进去,你必须声明一个公共类在你的Grasshopper.Kernel.GH_AssemblyInfo这个项目里(确保你能提供一个不带参数的构造函数)
为让你的GHA程序库使用这个面板,你必须在工程中声明一个Grasshopper.Kernel.GH_AssemblyInfo的公共类。
This is an abstractclass with a bunch of overridable readonly properties. If you override all thefields (especially AssemblyName and AssemblyIcon) your project will be includedon the banner. You should supply a 24 x24 pixel image.
这是一种带有一堆改变了只读属性的抽象类。如果你覆盖了所有的你将要包含在横幅里的项目的领域(特别是AssemblyName 和 AssemblyIcon)。你应该提供一个24 x24像素的图像里
这是一个带有很多可重载的只读属性的抽象类。如果你重载了所有字段,你的工程将出现在面板上面。
Here's a typicalVB.NET implementation:
下面是一个典型的VB.NET的实现(对接口的实现)
<code>PublicClass GH_GrasshopperLibraryInfo
Inherits GH_AssemblyInfo
Public OverridesReadOnly Property AssemblyName() As String
Get
Return"MyGHALibrary"
End Get
End Property
Public OverridesReadOnly Property AssemblyDescription() As String
Get
Return "MyTools for Grasshopper"
End Get
End Property
Public OverridesReadOnly Property AssemblyVersion() As String
Get
Return"1.0.0.0"
End Get
End Property
Public OverridesReadOnly Property AssemblyLicense() As GH_LibraryLicense
Get
ReturnGH_LibraryLicense.beta
End Get
End Property
Public OverridesReadOnly Property AssemblyIcon() As System.Drawing.Bitmap
Get
ReturnMy.Resources.MyLibraryIcon
End Get
End Property
Public OverridesReadOnly Property AuthorName() As String
Get
Return "MyCompany inc."
End Get
End Property
Public OverridesReadOnly Property AuthorContact() As String
Get
Return"http://www.MyGrasshopperTools.com"
End Get
End Property
EndClass</code>
The AuthorContactfield support multi-line strings, so feel free to add addresses, emails, phonenumbers etc. etc.
支持多行字符串的AuthorContact字段,所以您可以随意添加地址、电子邮件、电话号码等等
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Tags: Banner, Developer, GHA, Icon, Project
Views: 214
窗体顶端
|
{#aria.rich_text_area}
{#advanced.toolbar} |
Attach files (limit: 5MB)
§
§
§
Follow – Email me whenpeople reply
窗体底端
Permalink Reply by Luis Fraguada on October 12,2010 at 6:09pm
Hey David, I will try to implementthis...one question, until now I only see a + character on the splash screen.Am I supposed to press that to see the icons? Is there a toggle somewhere?
嘿,大卫,我试着实现这个接口,…有一个问题,直到现在我在开启屏幕只看到了一个+字符。我应该点击它去看图标吗?是否在某个地方有个按钮控制这玩意?
窗体顶端
Attach files (limit: 5MB)
窗体底端
§
Permalink Reply by taz on October 12,2010 at 7:18pm
Try Help > About... > togglethe "+" sign and gaze away!
§
窗体顶端
Attach files (limit: 5MB)
窗体底端
§
Permalink Reply by Luis Fraguada on October 17,2010 at 8:27am
Nice!
§
窗体顶端
窗体底端