To set the object status flags.

syntaxSyntax:
DlxObject.SetFlags(flags, mask)

Parameters

Parameter Description
flags Specifies values for object states. Specify a combination of the values in the following table.
mask Specifies which states are to be set. Specify a combination of the values in the following table.
Value Meaning
DlxApp.OBJFLAGS_VISIBLE Indicates whether the object should be visible or hidden. A hidden object cannot be selected.
DlxApp.OBJFLAGS_SELECTABLE Indicates if the object can be selected. When an object cannot be selected, it cannot be edited.
DlxApp.OBJFLAGS_SNAPPABLE Indicates whether the object's notable points are active for object snap operations.
DlxApp.OBJFLAGS_EDITABLE Indicates whether the object can be modified.
DlxApp.OBJFLAGS_PRINTABLE Indicates whether the object should be printed.
DlxApp.OBJFLAGS_MOVABLE Indicates if it is possible to move the object with the mouse.
DlxApp.OBJFLAGS_ROTATABLE Indicates whether the object can be rotated with the mouse.
DlxApp.OBJFLAGS_RESIZABLE Indicates if it is possible to resize the object with the mouse.
DlxApp.OBJFLAGS_DEFORMABLE Indicates whether the object can be tilted with the mouse.
DlxApp.OBJFLAGS_NEGATIVEONPCB Indicates that the object must be hidden when the symbol is loaded from the library.
DlxApp.OBJFLAGS_HIDDENINSYMBOL Indicates that the object is shown in negative on the copper areas of the PCB.

Return Value

If the object flags have been changed it returns true otherwise it returns false.

Example

  Copy codeCopy code
var prj = DlxApp.GetJob().GetProject("Example Sch");
if (!prj.IsValid())
  prj = DlxApp.GetJob().NewProject("Example Sch");
var doc = prj.GetDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
if (!doc.IsValid())
{
  doc = prj.NewDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
  doc.SetPageFormat("A4", false);
}
if (doc.IsValid() && doc.Activate())
{
  var page = doc.GetActivePage();
  if (page.IsValid())
  {
    var layer = page.GetLayerFromType(DlxApp.LAYERTYPE_DRAWING);
    if (layer.IsValid())
    {
      var pos = layer.GetFrontObjectPosition();
      while (pos.IsValid())
      {
        var obj = layer.GetNextObject(pos);
        if (!(obj.GetFlags() & DlxApp.OBJFLAGS_VISIBLE))
        {
          obj.SetFlags(DlxApp.OBJFLAGS_VISIBLE, DlxApp.OBJFLAGS_VISIBLE);
        }
        if (obj.GetFlags() & DlxApp.OBJFLAGS_PRINTABLE)
        {
          obj.SetFlags(0, DlxApp.OBJFLAGS_PRINTABLE);
        }
      }
    }
  }
}

See also