© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
44 replies
Laz

✅ C# CS0246

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.ApplicationServices;
using System.Windows.Forms;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.Attributes;

namespace WallFinishPlugin
{
    [Transaction(TransactionMode.Manual)]
    public class Main : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            var uiapp = commandData.Application;
            var uidoc = uiapp.ActiveUIDocument;
            var app = uiapp.Application;
            var doc = uidoc.Document;

            var collector = new FilteredElementCollector(doc)
                .OfCategory(BuiltInCategory.OST_Walls);

            var simpleForm = new SimpleForm();
            simpleForm.ShowDialog();


            return Result.Succeeded;

        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.ApplicationServices;
using System.Windows.Forms;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.Attributes;

namespace WallFinishPlugin
{
    [Transaction(TransactionMode.Manual)]
    public class Main : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            var uiapp = commandData.Application;
            var uidoc = uiapp.ActiveUIDocument;
            var app = uiapp.Application;
            var doc = uidoc.Document;

            var collector = new FilteredElementCollector(doc)
                .OfCategory(BuiltInCategory.OST_Walls);

            var simpleForm = new SimpleForm();
            simpleForm.ShowDialog();


            return Result.Succeeded;

        }
    }
}


Following https://www.youtube.com/watch?v=YV16JmCGNZA&list=PLABAnZRsrrL4xoeLvEmqtayeRC5b5GuwU&index=5&ab_channel=MariyanDeveloper
At 13;06
The SimpleForm() has an error of CS0246,


I have added
-> using System.Windows.Forms;
but still does not work

Can somebody help? (edited)
YouTubeMariyan Developer
Revit API Course for beginners | Lesson 3 | Element Selection
In this lecture you will learn about selection of Revit element via its API. We will discover what is the main class for doing it and how to use it.
I hope you enjoy the session and learn something new! Feel free to comment any feedback/questions below, or follow my channel if you enjoyed this.
If you want to get online classes text me on insta...
Revit API Course for beginners | Lesson 3 | Element Selection
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Error CS0246
C#CC# / help
2y ago
Bunch of CS0246 and CS0234 errors.
C#CC# / help
2y ago
✅ why am i getting the CS0246 error on unity for this code?
C#CC# / help
10mo ago
❔ binding c# and c++
C#CC# / help
3y ago