Hi,
Calling a form from class library. Error with rvtDoc and selSet.
Imports System
Imports Autodesk
Imports Autodesk.Revit
Imports System.Windows.Forms.Application
Imports Autodesk.Revit.DB
Imports Autodesk.Revit.UI
Public Class AnForm
Inherits System.Windows.Forms.Form
Implements Revit.IExternalCommand
Public elem As Element
Public Function GetParent(ByVal application As Creation.Application, ByRef message As String, ByVal elements As ElementSet) As Result Implements Revit.IExternalCommand.Execute
' get hold of a revit document.
'
Dim rvtDoc As Document = application.ActiveDocument
' get a list of selected elements.
'
Dim selSet As ElementSet = rvtDoc.Selection.Elements
' how many did you get?
Thank you,
Bob V
Sorry I never saw that GetParent implementation for IExternalCommand, only the default Execute method. Pretty sure this is not possible...
Revit requires that the plug-in contains the Execute method on the class, and that is the entry point. From there you can call any form.
Hope this make sense...
I think it was in Revit 2008 that I first created this addin. I created a form in Vb.net and called it in Revit api using External Tools. It allowed me to select objects and get and change parameters. I am calling the form AnForm from a class but I get errors with rvtDoc. Enrolled in a C# class for the fall so the tutorials and webcast will be easier to understand.
Thank you
Bob v
Can't find what you're looking for? Ask the community or share your knowledge.