天天看點

AutoCAD .NET API基礎(四) 了解屬性和方法

Understand Properties and Methods了解屬性和方法

Each object has associated properties and methods. Properties describe aspects of the individual object, while methods are actions that can be performed on the individual object. Once an object is created, you can query and edit the object through its properties and methods.

每個對象都伴随有屬性和方法。屬性用來描述對象的狀态,方法是在對象上能執行的動作。對象一旦建立,我們就可以通過其屬性和方法對其進行查詢和編輯。

For example, a Circle object has a Center property. This property represents the point in the world coordinate system (WCS) at the center of that circle. To change the center of the circle, simply set the Center property to a new point. The Circle object also has a method called GetOffsetCurves. This method creates a new object at a specified offset distance from the existing circle.

例如,Circle對象有Center屬性,該屬性代表圓心的坐标。要改變圓心,隻需簡單将Center屬性設定成新點即可。Circle對象還有一個GetOffsetCurves方法,該方法建立一個偏離已存在圓指定距離的新對象。

To see a list of all properties and methods for the Circle object, refer to the Circle object in the AutoCAD .NET Reference Guide or use the Object Browser in Microsoft® Visual Studio®. For more information on the Object Browser in Microsoft Visual Studio, see Access and Search Referenced Libraries (Object Browser).

檢視Circle對象的全部屬性和方法清單,參考AutoCAD .NET參考手冊中的Circle對象,或在Microsoft Visual Studio中使用對象浏覽器。

繼續閱讀