private ObjectIdCollection GetEntitiesOnLayer(string layerName)
{
Document doc = GetDocument();
Editor ed = GetEditor();
// Build a filter list so that only entities
// on the specified layer are selected
TypedValue[] tvs = new TypedValue[1] { new TypedValue((int)DxfCode.LayerName, layerName) };
SelectionFilter sf = new SelectionFilter(tvs);
PromptSelectionResult psr = ed.SelectAll(sf);
if (psr.Status == PromptStatus.OK)
return new ObjectIdCollection(psr.Value.GetObjectIds());
else
return new ObjectIdCollection();
}
댓글 없음:
댓글 쓰기