本帖最后由 Bao_lai 于 2024-3-9 19:18 编辑
- [LispFunction("GetEntNames")]
- public ResultBuffer GetEntNames(ResultBuffer args=null)
- {
- Document doc = Application.DocumentManager.MdiActiveDocument;
- Database db = doc.Database;
- Editor ed = doc.Editor;
-
- ResultBuffer rbrtn = new ResultBuffer();
- PromptSelectionResult psr = ed.GetSelection();
- if (psr.Status == PromptStatus.OK)
- {
- SelectionSet sSet = psr.Value;
- int i = 0;
- TypedValue[] ty = new TypedValue[sSet.Count];
- foreach (ObjectId id in sSet.GetObjectIds())
- {
- ty = new TypedValue((int)LispDataType.ObjectId, id);
- i++;
- }
- rbrtn = new ResultBuffer(ty);
- return rbrtn;
- }
- else
- {
- return null;
- }
- }
|