Generative Shape Design 

Creating Open Bodies in a Part Document


This macro shows you how to create Open Bodies in a Part Document : 

 

The macro creates a Part Document and creates Open Bodies.

 

CAAGsiCreateOpenBody is launched in CATIA [1]. No open document is needed.

CAAGsiCreateOpenBody.CATScript is located in the CAAScdGsiUseCases module. Execute macro (Windows only).

 

CAAGsiCreateOpenBody includes four steps:

  1. Creating the Part Document
  2. Retrieving the Part HybridBodies Collection Object to Attach 0pen Bodies
  3. Creating two Open Bodies in the Part Document
  4. Updating the Part Document

Creating the Part Document

' Creating  a Part Document 
  Dim PartDocument1 As Document
  Set PartDocument1 = CATIA.Documents.Add  ( "Part" ) 

Opens the Part Document. 

Retrieving the Part HybridBodies Collection Object to Attach Open Bodies

' Retrieving a Part HybridBodies collection to attaching OpenBodies     
  Dim hybridBodies1 As HybridBodies
  Set hybridBodies1 = PartDocument1.Part.HybridBodies

The Part HybridBodies collection Object is a pre-existing Object in the Part Document.
It is used to attachall OpenBodies to  a Part Document.
The wireframe and surface Objects can then be created and are automatically attached  to the active OpenBody.

The OpenBodies are used to structure wireframe and surface objects created in a CATPart Document in consistent set of features .

Create two Open Bodies in the Part Document 

 ' Add a first OpenBody  
  Dim OpenBody1 As HybridBody
  Set OpenBody1 = hybridBodies1.Add()

' Add a second OpenBody  
  Dim OpenBody2 As HybridBody
  Set OpenBody2 = hybridBodies1.Add()

The OpenBodies are created and attached to the Part Document

Note : An OpenBody cannot be attached to an other OpenBody , it should be associated with the HybridBodies collection Object 

Updating  the Part Document  

' Updating CATIA PArt 
  PartDocument1.Part.Update 

Updates the CATPart Document in order to visualize the Open Bodies created in the specification tree .

[Top]


In Short

This use case has shown how to create Open Bodies in a Part Document.

[Top]


References

[1] Replaying a Macro
[2] Hybrid Shapes Automation Objects

[Top]


Copyright © 2000, Dassault Systèmes. All rights reserved.