mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-06 05:01:35 +00:00
84 lines
5.9 KiB
Plaintext
84 lines
5.9 KiB
Plaintext
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fnil\fcharset0 Arial;}{\f3\fnil\fcharset0 Calibri;}}
|
|
{\colortbl ;\red0\green0\blue255;}
|
|
{\*\generator Riched20 10.0.19041}{\*\mmathPr\mdispDef1\mwrapIndent1440 }\viewkind4\uc1
|
|
\pard\nowidctlpar\b\f0\fs20 Application:\b0 InCanvasControlAPI\line\b Revit Platform:\b0 All\line\b Revit Version:\b0 2020.0\line\b First Released For:\b0 2020.0\line\b Programming Language:\b0 C#\line\b Skill Level:\b0 Beginning\line\b Category:\b0 Basics, Annotation\line\b Type:\b0 ExternalCommand and ExternalApplication\line\line\b Subject:\b0 In-Canvas controls\line\b Summary:\b0 \line This sample will demonstrate how to create, keep track of and handle clicks on In-Canvas controls.\i\f1\par
|
|
\i0\par
|
|
\b\f0 Classes:\cf1\b0 .\cf0\par
|
|
|
|
\pard\nowidctlpar\fi180\li180 Autodesk.Revit.UI.TemporaryGraphicsManager\par
|
|
Autodesk.Revit.UI.InCanvasControlData\par
|
|
Autodesk.Revit.UI.ITemporaryGraphicsHandler\par
|
|
Autodesk.Revit.UI.TemporaryGraphicsCommandData\par
|
|
\f1\lang1036\par
|
|
|
|
\pard\nowidctlpar\b\f0\lang1033 Project Files:\b0 \par
|
|
Application.cs\par
|
|
|
|
\pard\nowidctlpar\fi-360\li360 It contains an Application which inherits from interface IExternalApplication. On Revit launch, this external application registers a server which handles clicks on controls, and sets up the update event. This class shows the user how to register a server to handle In-Canvas control clicks.\i\par
|
|
|
|
\pard\nowidctlpar\i0 Command.cs\par
|
|
|
|
\pard\nowidctlpar\li360 It contains the class Command which inherits from interface IExternalCommand and implements the Execute method. This command creates an In-Canvas control on the next element picked by the user. \par
|
|
|
|
\pard\nowidctlpar\fi-360\li360 IssueMarker.cs\par
|
|
\tab It contains the class IssueMarker, which contains an index of the In-Canvas control it represents, InCanvasControlData with which it was created, and element id that it tracks. This class shows the user how to create an In-canvas control\line\par
|
|
IssueMarkerTracking.cs \line It contains the class IssueMarkerTracking, which has GetInstance method, SubscribeControl method, GetMarkerByElementId method, GetMarkerByIndex method, RemoveMarkerByElement method, SetSelected and GetSelected methods, and a set of IssueMarkers. The IssueMarkers are added to the map upon creation (using SubscribeControl method)\par
|
|
IssueMarkerTrackingManager.cs \par
|
|
\tab It contains class IssueMarkerTrackingManager, which has a map of Documents and Trackings, GUIDs and Trackings, methods GetTracking, AddTracking, DeleteTracking, ClearTrackings methods.\line\par
|
|
IssueMarkerUpdater.cs\par
|
|
\tab It contains the class IssueMarkerUpdater. The class has an Execute method. Execute method is invoked by OnDocumentChanged event and updates Issue markers' position to match the modified elements'. This class shows the user how to change In-canvas control's position.\par
|
|
\par
|
|
IssueSelectHandler.cs\par
|
|
\tab It contains the class IssueSelectHandler which inherits from interface ITemporaryGraphicsHandler and implements it. Its implementation of OnClick method \f2 calls to issue marker selector with click data's control index and document the control was on. This class shows the user how to handle clicks on In-Canvas controls\par
|
|
IssueMarkerSelector.cs\par
|
|
\tab It contains the class IssueMarkerSelector, which has a method SelectControl. This selector changes the image on controls based on which one is selected. This class shows how to change In-canvas control's image.\f0\par
|
|
|
|
\pard\nowidctlpar\f1\lang1036\par
|
|
\b\lang1033\par
|
|
\f0 Description:\b0 \f1\par
|
|
\f0 This sample provides following functionalities.\par
|
|
|
|
\pard\nowidctlpar\fi-360\li360\tx360 -\tab Let user create controls on the position of a selected element.\par
|
|
-\tab Let user generate events by clicking on the controls.\par
|
|
-\tab The controls follow the elements on the position of which they were created. The controls will be deleted as well when the element is deleted. \par
|
|
|
|
\pard\nowidctlpar\f1\par
|
|
\b\f0 Instructions:\b0 \f1\par
|
|
\f0 Open Revit application and open a document, and execute the command.\par
|
|
|
|
\pard\nowidctlpar\fi-360\li360\tx360 1.\tab Create controls on element position.\par
|
|
|
|
\pard\nowidctlpar\li765 a. Execute the command\par
|
|
\tab\i Alternitavely: \i0 Click the button, in the tab \i Add-Ins\i0 , in the panel \i Issues, \i0 called "Create issue marker on an element"\par
|
|
b. Click on an element\par
|
|
Expected result: A button - a control - will appear on top of the selected element.\par
|
|
\par
|
|
|
|
\pard\nowidctlpar\fi-360\li360\tx360 2.\tab Move the control\par
|
|
|
|
\pard\nowidctlpar\fi-360\li1080\tx1080 a.\tab Create a control with instructions in 1.\par
|
|
|
|
\pard\nowidctlpar\fi-360\li1080 b.\tab Move the element on which the control was created\par
|
|
|
|
\pard\nowidctlpar\li720 Expected result: The updater in this sample will update the control with the new position - it should move on top of the element's new position.\par
|
|
|
|
\pard\nowidctlpar\li360\par
|
|
|
|
\pard\nowidctlpar\fi-360\li360\tx360 3.\tab Delete the control.\par
|
|
|
|
\pard\nowidctlpar\fi-360\li1080\tx1080 a.\tab Create a control with instructions in 1.\par
|
|
|
|
\pard\nowidctlpar\fi-360\li1080 b.\tab Delete the element on which the control was created\par
|
|
|
|
\pard\nowidctlpar\li720 Expected result: The updater in this sample will delete the control - it should disappear.\par
|
|
|
|
\pard\nowidctlpar\f1\par
|
|
\par
|
|
|
|
\pard\fi-720\li720\sa200\sl276\slmult1\f2\lang9 4. Select the control\line a. \lang1033 Create a control with instructions in 1.\line\lang9 b. Click on the control.\line Expected result: In this sample, clicking the control switches it's image between the two preset bitmaps. A "selected" control will have a different image than the other controls, which will share the same one.There can only be one selected control.\par
|
|
|
|
\pard\sa200\sl276\slmult1\f3\fs22\par
|
|
\par
|
|
\par
|
|
}
|
|
|