Author Topic: Filtering Xdata using wildcards  (Read 1347 times)

0 Members and 1 Guest are viewing this topic.

SamR

  • Mosquito
  • Posts: 15
Filtering Xdata using wildcards
« on: August 30, 2011, 03:15:46 PM »
Is it possible to filter the "XData" AppName including wildcards.
Ie.
 "MyAppName" & *  will return all the entities
 "MyAppName_DataSet1" & * will be a bit more specific

Edit: I'm rethinking whether this is necessary but can't delete the post.
« Last Edit: August 30, 2011, 03:26:31 PM by SamR »

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Filtering Xdata using wildcards
« Reply #1 on: September 12, 2011, 03:33:22 PM »
You could iterate the RegAppTable and use a if statement with something like
RegAppTableRecord.Name.StartsWith("Whatever")
Then grab the entites that reference it

gile

  • Gator
  • Posts: 2520
  • Marseille, France
Re: Filtering Xdata using wildcards
« Reply #2 on: September 12, 2011, 04:11:10 PM »
Hi,

You can use wilcard patterns with regapp names in a selection filter.

Code: [Select]
        [CommandMethod("Test")]
        public void Test()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            TypedValue[] filter = { new TypedValue(1001,  "MyAppName*") };
            PromptSelectionResult psr = ed.GetSelection(new SelectionFilter(filter));
            if (psr.Status != PromptStatus.OK) return;
            ed.SetImpliedSelection(psr.Value.GetObjectIds());
        }
Speaking English as a French Frog

SamR

  • Mosquito
  • Posts: 15
Re: Filtering Xdata using wildcards
« Reply #3 on: September 12, 2011, 04:40:37 PM »
ohh....that's something I probably should have tried.
Thankyou!