첫 번째 열의 값에 따라 AutoCAD에서 테이블 행을 삭제하는 방법을 쓰고 있습니다.C#을 사용하여 AutoCAD에서 테이블 행 삭제
내 코드는 다음과 같습니다
public void deleteRow(String openingName)
{
Transaction tr = doc.TransactionManager.StartTransaction();
DocumentLock docLock = doc.LockDocument();
using (tr)
using (docLock)
{
if (!IsWriteEnabled || !IsReadEnabled) //Committing transactions closes everything for reading and writing so it must be reopened
{
tr.GetObject(this.ObjectId, OpenMode.ForRead);
tr.GetObject(this.ObjectId, OpenMode.ForWrite);
}
for (int i = 1; i < NumRows; i++)
{
if (Cells[i, 0].GetTextString(FormatOption.ForExpression).Equals(openingName))
{
DeleteRows(i, 1);
}
}
GenerateLayout();
tr.Commit();
}
}
는 그러나이하는 모든 빈 행을 떠나, 행의 셀의 값을 삭제합니다.
어떻게 행 자체를 제거합니까?
DeteRows 메서드 란 무엇입니까? – Alireza
위치 i에서 행이 삭제 될 것이라고 생각했지만 그 행에있는 셀은 모두 비어 있습니다. –