Files
RevitSdkSamples/snapshot/2008/SDK/Samples/Toolbar/VB.NET/ReadMe_Toolbar.rtf
T

135 lines
41 KiB
Plaintext
Raw Normal View History

2024-12-12 09:51:40 +01:00
ÐÏࡱá>þÿ MOþÿÿÿLÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿì¥Áq` ðR¿¡bjbjqPqP 2*::¡ ÿÿÿÿÿÿ¤NNNNNNNbjjjj4žb6öÆÆÆÆÆÆÆÆþ5666666$u8hÝ:B$6NÆÆÆÆÆ$6NNÆÆ96^^^ÆÞNÆNÆþ5^Æþ5^^Žb!hNNz"ƺ På!æj¤RÊ!þ5O606Ú! ;ö^; z";Nz"ÆÆ^ÆÆÆÆÆ$6$6T
ÆÆÆ6ÆÆÆÆbbbf bbbf bbbNNNNNNÿÿÿÿ Application: Toolbar
Revit product and version: All
Last Modified: 20/12/2006
Modified By: CL Autodesk HSL
Programming Language: VB.NET
Subject: This sample demonstrates how to create custom toolbar and how to create different types toolbar items.
Classes:
Autodesk.Revit.IExternalCommand
Autodesk.Revit.IExternalApplication
Autodesk.Revit.Toolbar
Autodesk.Revit.ToolbarItem
Autodesk.Revit.MenuItem
Autodesk.Revit.Creation.Document
Project Files:
ExternalApplication.vb
The main DLL source file contains the class CreateToolbar which inherits from interface IExternalApplication and implements method OnStartUp. The class will add a custom toolbar with three buttons
Description:
This sample provides the following functionalities:
Add a custom toolbar with three buttons into Revit and Use Application.NewToolbar() to create the Toolbar via API.
Add a Custom Toolbar with three buttons into Revit.
Between the second button and the third button there is a separator.
Every button should have a corresponding command to execute. The command should implement the interface of IExternalCommand.
The first button will create a wall. Use Toolbar.AddItem(MenuItem) to add this button .
The second button will delete all walls in current project. Use Toolbar.AddItem(String, String) to add this button .
The third button will pop up a dialog box and show some information about Customer Toolbar.
There are two types of ToolbarItem, the third button has image only and the others two have both image and text.
Every button has a ToolTip when mouse on it.
Every button has a tip in Revit status bar to describe the button usage when it gets focus.
Implementation Notes
The command, which will be executed when the ToolbarItem button is clicked, should derive from IExternalCommand.
The Toolbar can be created via API: Application.NewToolbar().
The ToolbarItem button can be added via API: Toobar.AddItem(MenuItem) or Toobar.AddItem(String, String).
The separator is a ToolbarItem too, we can use AddItem(nullptr) to create this separator; or we can set the ToolbarItems ToolbarItemType property with ToolbarItemType::BtnSeparator.
The Image property of toolbar will affect the image of each ToolbarItem. Besides, the ImageIndex of toolbar will affect the image of ToolbarItem too.
ToolbarItem.ToolTip can set the tip when mouse move on the ToolbarItem button.
ToolbarItem.StatusbarTip can set the tip in Revit status bar when the ToolbarItem button gets focus.
Instructions:
Make sure there are following settings in Revit.ini file.
[ExternalApplications]
EACount = 1
EAName1 = Custom Toolbar
EAClassName1 = Revit.SDK.Samples.Toolbar.CS.CreateToolbar
EAAssembly1 = (your path)\Toolbar.dll
EADescription1 = "Add a Custom Toolbar with three buttons into Revit"
Copy the Commands.dll and Toolbar.bmp to the same directory of this sample dll.
Run Revit, then you can see the custom toolbar with three buttons in Revit.
Click the first button will create a wall in Revit; click the second button will delete all walls in Revit, click the third button will pop up a dialog which list some information about custom toolbar.
Notes:
When compile this sample, please make sure you have compiled the Commands sample successfully.
«ŠOJPJQJ^JnHtHŠOJQJ^J$
«ŠOJPJQJ^JnHtH!
«ŠB*OJQJ^Jphÿ$hd&©ŠOJPJQJ^JnHtH$hA/ŠOJPJQJ^JnHtHŠOJPJQJ^JnHtH
«ŠOJQJ^J
«Š5OJQJ\^J"4Nkˆùú % I ` { ´ µ Å Ü ¢
£
±
å
ùôùôôôôéùÞÞÞÞÞÞôôôÍÄô¿gdÅŠ„Y^„YgdÅŠ„h1$7$8$H$VD^„hgdÅŠ
„hWD´`„hgdÅŠ
WD`„ gdÅŠgdÅŠ@&gdÅŠ¡ý_ ` n { Š ³ ´ µ Ã Ä Å Ù Û Ü 
*
H
M
X
h
ðÝÍÝÍ·¤‘tg]¤J4J4J4*Š0JCJOJPJQJ^JaJnHtH$h¶"ÍŠ0JCJOJQJ^JaJŠOJQJ^JhA/ŠOJQJ^J
«ŠOJQJ^J
«Š5OJQJ\^J$
«ŠOJPJQJ^JnHtH$hA/ŠOJPJQJ^JnHtH+hA/ŠOJPJQJ^JmHnHtHuŠOJPJQJ^JnHtH$hA/ŠOJPJQJ^JnHtHŠOJPJQJ^JnHtHh
j
}

 
¢
£
¯
°
±
À
Ä
Å
à
ã
ä
å
í×íÀí×í×­}l^J^Jl8"ŠCJOJPJQJaJnHtH&ŠCJOJPJQJ^JaJnHtHŠCJOJQJ^JaJ 
«ŠCJOJQJ^JaJ$
«ŠOJPJQJ^JnHtH
«ŠOJQJ^J
«Š5OJQJ\^J$ŠOJPJQJ^JnHtH-hA"0JCJOJPJQJ^JaJnHo(tH*Š0JCJOJPJQJ^JaJnHtH$h¶"ÍŠ0JCJOJQJ^JaJå
ë
ì
ò
ó
ÿ
  8 W X Y sˆ¡¢¯°±êóãóãóÒóãÅã󸫚zjYBã-
«ŠB*OJPJQJ^JnHphÿtH!
«ŠB*OJQJ^Jphÿ
«Š5OJQJ\^J$h‰(6ŠOJPJQJ^JnHtHh¿FXŠOJQJ^J höy<ŠCJOJQJ^JaJh‰(6ŠOJQJ^JhÎ<NŠOJQJ^Jh©d2ŠOJQJ^J ¡ŠOJQJ^JnHtHŠOJPJQJ^JnHtH¡ŠOJQJ^Jå
Y Ž Ó P ¨ 
y
ê
sˆù7 Wí<¡¢±ë)÷÷÷÷÷÷÷÷÷÷ò÷÷÷÷÷÷÷íçßÔÔÔ
„ÐVD,^„ÐgdÅŠ
& FgdÅŠ@&gdÅŠgdÅŠgdÅŠ
& FgdÅŠêë  ps}~ÐÑ !$*mn789>óàÍàÍàÍ·§à”„w„j„j„\O;'h>>$5OJPJQJ\^JnHo(tHh7OSh>>$OJQJ^Jh>>$ŠOJQJ^Jo(
«ŠOJQJ^Jh¨2šŠOJQJ^JŠOJPJQJ^JnHtH$h)}²ŠOJPJQJ^JnHtHŠOJPJQJ^JnHtH*hhesŠ6OJPJQJ]^JnHtH$h)}²hA"OJPJQJ^JnHtH$h)}²ŠOJPJQJ^JnHtHhi¼ŠOJQJ^J)dÑ!n89A ¡ôôôìììçáÙÔgdÅŠ
& FgdÆ.<@&gdgãgd>>$
& FgdÅŠ
„ÐVD,^„ÐgdÅŠ
>?@AFNpu|}žŸ ¡ðßÈ´£´’´’´´m_hgãhgãPJnHo(tH'hgãh OJPJQJ^JnHo(tH!hfOJPJQJ^JnHo(tH!hjY…OJPJQJ^JnHo(tH!h>>$OJPJQJ^JnHo(tH'hgãhgãOJPJQJ^JnHo(tH-
«hgãB*OJPJQJ^JnHphÿtH!
«hgãB*OJQJ^Jphÿ
«hgã5OJQJ\^J01hP°Ð/ °à=!°# $ °Ð°Ð Ð
l (kôÿÁ(No ListDZ@òD 
Plain TextCJOJQJ^JaJZþO¢Z  Plain Text Char$OJPJQJ^J_HmH nHsH tH¡ *ÿÿÿÿ4Nkˆùú%I`{´µÅÜ¢£±åYŽÓP¨yêsˆù7 Wí< ¡ ¢ ± ë 

)
d
Ñ
! n 8 9 A   £ 0˜00˜0€4˜0€4˜0€4˜0€4˜€40˜€ú˜€ú˜€ú˜€ú˜€ú˜€ú˜0€ú˜0€ú˜0€ú˜€ú˜0€ú˜0€ú˜0€ú˜ 0€ú˜ 0€ú˜ 0€ú˜ 0€ú˜ 0€ú˜ 0€ú˜ 0€ú˜ 0€ú˜ 0€ú˜ 0 €ú˜0€ú˜ 0
€ú˜ 0 €ú˜ 0 €ú˜ 0