Automatic selection

Automatic selection

Anonymous
Not applicable
701 Views
3 Replies
Message 1 of 4

Automatic selection

Anonymous
Not applicable

Hello,

Here is a code where the user makes the selection of objects in the drawing, having a filter with two criteria:
Type and block with Dimension layer.
My question is:
How can I check is the same, without requiring the user to select objects in the drawing? (An automatic selection)
Thanks
Robson (Brazil)

0 Likes
702 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Choirs colleagues

Sorry, had posted the code before.

 

[CommandMethod("COTAS")]

public void cotas()

{

     Document documento = Application.DocumentManager.MdiActiveDocument;

     Database bancoDados = documento.Database;

     Editor editor = documento.Editor;

 

     TypedValue[] criterio = new TypedValue[2];

     criterio.SetValue(new TypedValue((int)DxfCode.Start, "INSERT"), 0);

     criterio.SetValue(new TypedValue((int)DxfCode.LayerName, "Dimension"), 1);

 

     SelectionFilter selecao = new SelectionFilter(criterio);

 

     PromptSelectionResult selPrompt;

     selPrompt = editor.GetSelection(selecao);

 

     if (selPrompt.Status == PromptStatus.OK)

          {

               SelectionSet ssSet = selPrompt.Value;

          }

     }

}

 

Robson (Brazil)

0 Likes
Message 3 of 4

Anonymous
Not applicable

Instead of GetSelection(), use SelectAll().

0 Likes
Message 4 of 4

Anonymous
Not applicable

caddzone,

Thanks for the help, worked perfectly.

Hug.
Robson (Brazil)

0 Likes