Announcements
Atención para clientes sin autenticación multifactor o inicio de sesión único: la verificación OTP se implementará en abril de 2025. Lee todo al respecto aquí.
Hominis06
in reply to: Anonymous

Hello @Anonymous 
Error means exactly what is written in error code

When you type:

Document doc = this.ActiveUIDocument.Document;

 you mean, that you want accessing to property "ActiveUIDocument" of "Class1"

However, I can't see property "ActiveUIDocument" in your code snippet. Also "Class1" doesn't inherit from any class, that might contain this property. That's why compiler throws an error.

To avoid this error, modify your code like this:

........
public class Class1
{
    public UIDocument ActiveUIDocument { get; private set; }//define property with private set signature - it means you can't asign property value outside of your class
    public Class1(UIDocument uIDocument)//define constructor
    {
        ActiveUIDocument = uIDocument;//asign value to your property
    }
.........//the rest of the code snippet remains unchanged
}