天天看點

CATIA V6二次開發——Automation之屬性和方法1.Automation之屬性2.Automation之方法

1.Automation之屬性

屬性是描述一個對象某個方面特性的值,這個值可能是對象,也可能是普通資料類型(整數、實數、字元串等)。 比如 CATIA 中一個通過三個坐标值建立的點(HybridShapePointCoord)對象,具有 X、Y、Z 三個屬性,分别對應其 X、Y、Z坐标。PtRef 屬性表示點對象坐标的參考點, RefAxisSystem表示建立點所用的參考坐标系。在 Automation 中 HybridShapePointCoord 的屬性描述如下圖所示:
CATIA V6二次開發——Automation之屬性和方法1.Automation之屬性2.Automation之方法

以HybridBody對象為例,其包括GeometricElements 、HybridBodies 、HybridShapes 、HybridSketches 四個屬性,包括AppendHybridShape 一種方法。

CATIA V6二次開發——Automation之屬性和方法1.Automation之屬性2.Automation之方法
CATIA V6二次開發——Automation之屬性和方法1.Automation之屬性2.Automation之方法

2.Automation之方法

方法即是對象的功能,如果說屬性是遊戲人物的本身特性,那麼方法則是遊戲人物的技能。

CATIA V6二次開發——Automation之屬性和方法1.Automation之屬性2.Automation之方法

還是以HybridBody的方法為例,查閱Automation手冊幫助文檔,AppendHybridShape 方法能實作将幾何元素加入到幾何圖形集中。

關于點線面構造方法,已在《CATIA 3DEXPERIENCE R2019x VBA開發介紹》博文中詳述,此處不在講述。

參考資料:

1.《CATIA VBA二次開發入門與提高》

2.《CATIA二次開發—API梳理》——硬核小青年

3. DSYAutomation.chm

CATIA V6二次開發——Automation之屬性和方法1.Automation之屬性2.Automation之方法
CATIA V6二次開發——Automation之屬性和方法1.Automation之屬性2.Automation之方法