public QLElementCollection SetSelection(IResolveFieldContext context, List <string> input)
        {
            Document   _doc   = ResolverEntry.Doc;
            UIDocument _uidoc = ResolverEntry.UiDoc;

            Selection selection = _uidoc.Selection;

            ICollection <ElementId> elementIds = selection.GetElementIds();

            elementIds.Clear();

            foreach (var aString in input)
            {
                elementIds.Add(new ElementId(int.Parse(aString)));
            }


            ResolverEntry.aRevitTask.Run(app =>
            {
                if (elementIds.Count > 0)
                {
                    selection.SetElementIds(elementIds);
                }
            });

            //var qlFamilyInstancesField = GraphQlHelpers.GetFieldFromContext(context, "qlFamilyInstances");
            //var qlFabricationPartsField = GraphQlHelpers.GetFieldFromContext(context, "qlFabricationParts");

            QLElementCollection qlElementCollection = new QLElementCollectionResolve(elementIds, context);

            return(qlElementCollection);
        }
Exemple #2
0
        public QLElementCollection GetSelection(IResolveFieldContext context, string[] nameFilter = null)
        {
            Document   _doc   = ResolverEntry.Doc;
            UIDocument _uidoc = ResolverEntry.UiDoc;

            Selection selection = _uidoc.Selection;
            var       qlFamilyInstancesField  = GraphQlHelpers.GetFieldFromContext(context, "qlFamilyInstances");
            var       qlFabricationPartsField = GraphQlHelpers.GetFieldFromContext(context, "qlFabricationParts");

            ICollection <ElementId> elementIds          = selection.GetElementIds();
            QLElementCollection     qlElementCollection = new QLElementCollectionResolve(elementIds, qlFamilyInstancesField, qlFabricationPartsField);

            return(qlElementCollection);
        }