ActiveParameters

Namespace: Digi21.DigiNG
Assembly: Digi21.DigiNG.Plugin

Digi3D.AI's active parameters: active angle, active distances, text height, contour interval and active scale. Digi3D.AI commands use these values when digitizing.

public sealed class ActiveParameters

The class has no public constructors. Obtain the object through the static DigiNG.ActiveParameters property, which returns null if no drawing window is open. The object is bound to the drawing window active when it is obtained: when that window closes, all properties throw ObjectDisposedException.

All properties except Scale read and write Digi3D.AI variables shared by all drawing windows. Scale belongs to the drawing window.

Properties

Property Description
double ActiveAngle Active angle, in radians. Digi3D.AI stores the value in degrees: the AA variable. If the variable does not exist, returns the equivalent of 10°.
double PrincipalActiveDistance Active distance. The first value of AD. If the variable does not exist, returns 1.
double SecondaryActiveDistance Secondary active distance. The second value of AD. If the variable does not exist, returns 1.
double TextHeight Text height. The TH variable. If the variable does not exist, returns 1.
double Equidistance Contour interval. The EQUIDISTANCE variable. If the variable does not exist, returns 1.
Point3D Scale Drawing window's active scale in X, Y and Z, used by commands such as INS and INSR.

Example

This command rotates the active angle by 90° and writes the new value in degrees to the results window:

using Digi21.Digi3D;
using Digi21.DigiNG;
using Digi21.DigiNG.Plugin.Command;

namespace Ejemplos;

[Command(Name = "GIRA_ANGULO_ACTIVO")]
public class GiraAnguloActivo : Command
{
    public GiraAnguloActivo()
    {
        Initialize += (sender, e) =>
        {
            var parámetros = DigiNG.ActiveParameters;

            // ActiveAngle is in radians.
            parámetros.ActiveAngle = (parámetros.ActiveAngle + Math.PI / 2) % (2 * Math.PI);

            Digi3D.OutputWindow.Show();
            Digi3D.OutputWindow.WriteLine($"Ángulo activo: {parámetros.ActiveAngle * 180 / Math.PI:F2}°");
            Dispose();
        };
    }
}