주어진 경로 도면 파일을 연 다음 도면의 모든 선을 선택한 다음 선의 목록 번호를 선택해야합니다. 내가 MdiActiveDocument 메서드를 열고 설정하는 동안 반환되기 때문에 나는 이러한 일을 할 수 없습니다. 아래 라인은 실행되지 않습니다.C#을 사용하여 AutoCAD에서 지정된 도면에서 Select 객체를 수행 할 수 없습니다?
private static int GetNumberofLines(string drawingName)
{
int lineCount = 0;
DocumentCollection docMgr = AutoCAD.ApplicationServices.Application.DocumentManager;
Document doc = docMgr.Open(drawingName, false);
docMgr.MdiActiveDocument = doc; // in this line method is skipped
TypedValue[] filterlist = new TypedValue[1]; //cursor didn't come this line..
filterlist[0] = new TypedValue((int)DxfCode.Start, "Line");
SelectionFilter filter = new SelectionFilter(filterlist);
PromptSelectionOptions opts = new PromptSelectionOptions();
opts.MessageForAdding = "Select entities to get line counts: ";
PromptSelectionResult prmptSelRslt = doc.Editor.SelectAll(filter);
if (prmptSelRslt.Status != PromptStatus.OK)
{
return 0;
}
else
{
lineCount = prmptSelRslt.Value.Count;
}
return lineCount;
}
누구든지 내게 줄 번호를 나열하는 방법을 말해 줄 수 있습니까?
감사의 말 ....
감사 ... 알랭 .. – Sivaperuman