Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tonicanada
Created August 17, 2022 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonicanada/d09a54b49143ccea8d3299ed77dbeeb0 to your computer and use it in GitHub Desktop.
Save tonicanada/d09a54b49143ccea8d3299ed77dbeeb0 to your computer and use it in GitHub Desktop.
using System;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
namespace ShortestPathMatrix
{
public class GraphModelSelector
{
public static ObjectId[] selectGraph(Document acDoc, String selection_prompt_message, SelectionFilter filtro_entidades = null)
{
PromptSelectionResult acSPrompt;
PromptSelectionOptions PtSelOpts = new PromptSelectionOptions();
PtSelOpts.MessageForAdding = $"\n{selection_prompt_message}";
acSPrompt = acDoc.Editor.GetSelection(PtSelOpts, filtro_entidades);
SelectionSet acSSetBlocks;
if (acSPrompt.Status == PromptStatus.OK)
{
acSSetBlocks = acSPrompt.Value;
ObjectId[] objIdArrayTotal = acSSetBlocks.GetObjectIds();
return objIdArrayTotal;
}
else
{
return null;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment