I decided to create a command that would allow me to walk through the worksets within a project, the idea being that a form can show a list of the worksets in the active document then as you pick one of them it will turn off the display of all other worksets in the active view. This will allow you to check quickly if objects are on the wrong workset, for example if you select Shared Levels and Grids and you can see walls in the view, then you have a problem!I created my form with a listview box as you can see to the right, however I came across a problem when trying to access the Application within the code.
So far I have used the following to reference the application:
Public Function Execute(ByVal commandData As ExternalCommandData............
Dim uiapp As UIApplication = commandData.Application
However in the form code there is no commandData, so I had to change the definition of the uiapp to a Shared item.
Public Class AdskCommand
Implements IExternalCommand
Public Shared uiapp As UIApplication
Public Function
Execute(ByVal commandData As ExternalCommandData,........
uiapp
= commandData.ApplicationThis allows me to reference the uiapp in the Execute function when the command starts and also with this code:
Private Sub lstWorkSets_Click(sender As Object, e As System.EventArgs) Handles lstWorkSets.Click
Dim uidoc As UIDocument = AdskCommand.uiapp.ActiveUIDocument
Thank you Sir, you're iDeas are excellent. i am learning Revit API, being a beginner your tutorials are Excellent.
ReplyDeleteIs this Application .ddl is available for download.
ReplyDeleteNot at present, sorry
ReplyDeleteHi, Nice description about Revit API vb.Net.Thanks, its really helped me......
ReplyDelete-Aparna
Theosoft
me too i really like it... and going through step by step.... i hope you keep posting on your blog :)
ReplyDelete-Moustafa
GAJ