Author Topic: Using Selectionfilter for leader and mleader  (Read 122 times)

0 Members and 1 Guest are viewing this topic.

latour_g

  • Newt
  • Posts: 174
Using Selectionfilter for leader and mleader
« on: November 25, 2021, 11:26:54 AM »
Hi all,

I'm trying to use selectionfilter to select only leader and mleader.  What I've done above doesn't work. 

I tried with Line, Circle, Polyline and it's working fine.

Thank you !

Code - C#: [Select]
  1.             string objects = ("LEADER,MLEADER");
  2.             //string objects = ("LINE,CIRCLE,POLYLINE");
  3.  
  4.             TypedValue[] values = new TypedValue[1] { new TypedValue((int)DxfCode.Start, objects) };
  5.             SelectionFilter filter = new SelectionFilter(values);
  6.  
  7.             PromptSelectionOptions SelOpts = new PromptSelectionOptions();
  8.             SelOpts.AllowDuplicates = false;
  9.             SelOpts.MessageForAdding = "\nSélectionner Leader ou Mleader";
  10.             SelOpts.MessageForRemoval = "\nSélectionnez des objets à enlever de la sélection :";
  11.             Utils.SetFocusToDwgView();
  12.             PromptSelectionResult res = ed.GetSelection(SelOpts, filter);
  13.             if (res.Status != PromptStatus.OK) return;
  14.  
  15.  

Jeff_M

  • King Gator
  • Posts: 4018
  • C3D user & customizer
Re: Using Selectionfilter for leader and mleader
« Reply #1 on: November 25, 2021, 01:19:34 PM »
Either of these should work
Code - C#: [Select]
  1. string objects = ("LEADER,MULTILEADER");
  2.  

or

Code - C#: [Select]
  1. string objects = ("*LEADER");
  2.  

latour_g

  • Newt
  • Posts: 174
Re: Using Selectionfilter for leader and mleader
« Reply #2 on: November 25, 2021, 01:32:34 PM »
You are totally right ! Thank you SO much !