马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
 - [LispFunction("ReturnSet")]
- public static Object ReturnSS(ResultBuffer args)
- {
- // extract Arguments
- ResultBuffer argsOut = new ResultBuffer();
- //Database db = Application.DocumentManager.MdiActiveDocument.Database;
- Database db = HostApplicationServices.WorkingDatabase;
- Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
- PromptSelectionOptions peo = new PromptSelectionOptions();
- peo.MessageForAdding = "\nSelect Entities for Selection";
- peo.AllowDuplicates = false;
- PromptSelectionResult psr = ed.GetSelection(peo);
- ObjectId[] ids = new ObjectId[0];
- SelectionSet ss = SelectionSet.FromObjectIds(ids);
- ss = psr.Value as SelectionSet;
- ObjectId[] idarray = ss.GetObjectIds();
- argsOut.Add(new TypedValue((int)LispDataType.SelectionSet, ss));
- foreach (ObjectId oid in idarray)
- {
- argsOut.Add(new TypedValue((int)LispDataType.ObjectId, oid));
- argsOut.Add(new TypedValue((int)LispDataType.Text, oid.Handle.ToString()));
- }
- return argsOut;
- }
|