MLightCAD
    Preparing search index...

    Function useLayerFilters

    • Layer-filter composable for Layer Manager and other layer pickers.

      Reads the AutoCAD Layer Properties Manager tree from AcDbDatabase.layerFilters (AcLyLayerFilter / AcLyLayerGroup), not the flat AcDbDatabase.objects.layerFilter index dictionary.

      The selected filter is shared globally; the filter tree snapshot is per caller.

      Parameters

      • editor: AcApDocManager

        Application document manager that owns the active drawing.

      Returns {
          createGroupFilter: (
              preferredName?: string,
              layerIds?: readonly string[],
          ) => string | null;
          createNamedFilter: (
              layerNames?: readonly string[],
              preferredName?: string,
          ) => string | null;
          filterTree: Reactive<LayerFilterTreeNodeInfo[]>;
          matchesSelectedFilter: (layer: AcDbLayerTableRecord) => boolean;
          selectedFilterId: Ref<string, string>;
          syncFromDatabase: () => void;
      }

      • createGroupFilter: (preferredName?: string, layerIds?: readonly string[]) => string | null

        Creates a group filter. See createGroupFilter.

      • createNamedFilter: (layerNames?: readonly string[], preferredName?: string) => string | null

        Creates a property filter. See createNamedFilter.

      • filterTree: Reactive<LayerFilterTreeNodeInfo[]>

        Nested filter nodes under the synthetic All root (excluding built-ins).

      • matchesSelectedFilter: (layer: AcDbLayerTableRecord) => boolean

        Whether the selected filter accepts the given layer record.

      • selectedFilterId: Ref<string, string>

        Currently selected filter tree node id (shared globally).

      • syncFromDatabase: () => void

        Re-reads filters from the active database.