How can I make this work?
Code: Select all
public static void Execute()
{
var document = Application.DocumentManager.MdiActiveDocument;
var database = document.Database;
var selection = CommandHelper.GetOrAskSelection(document);
var selectionSet = selection.Value;
using (var transaction = database.TransactionManager.StartTransaction())
{
var curves = new List<Curve3d>();
foreach (var id in selectionSet.GetObjectIds())
{
var entity = (Entity) transaction.GetObject(id, OpenMode.ForRead);
if (entity is Curve curve)
{
curves.Add(curve.GetGeCurve()); <-- error here
}
}
}
}