Structure Functional Design

Creating Openings


This macro shows you how to create openings.

CAASfdCreateOpening is launched in CATIA [1]. First open Product1.CATProduct in the CAAScdSfdsamples/CreateOpening directory.

CAASfdCreateOpening.CATScript is located in the CAAScdSfdUseCases. Execute macro (Windows only).

CAASfdCreateOpening includes three steps:

  1. Prolog
  2. Retrieving the Factory and Creating an Opening Using the Sketch Mode
  3. Retrieving the Factory and Creating an Opening Using the 3D Object Mode

Prolog

Opens the CAASfdCreateOpening.CATPart in CATIA.

Sub CATMain()

  Dim part1 As Part
  Set part1 = CATIA.ActiveDocument.Part
  Dim plate As SfmSuperPlate
  Set plate = part1.FindObjectByName ("Deck_005")

  Dim plateref As Reference
  Set plateref = part1.CreateReferenceFromObject (plate)
  ...

Retrieving the Factory and Creating an Opening Using the Sketch Mode

This step describes how to get the Structure Functional Modeler factory object from the Part object thanks to the GetCustomerFactory method.

  ...
  'Create Opening Using Sketch Mode

  Dim sketch As Sketch
  Set sketch = part1.FindObjectByName ("Sketch.19")
  Dim sketchref As Reference
  Set sketchref =part1.CreateReferenceFromObject(sketch)

  Dim Factory As SfmFunctionFactory
  Set Factory = part1.GetCustomerFactory ("SfmFunctionFactory")
  Dim OpeningUsingSketch As SfmOpening
  Set OpeningUsingSketch = Factory. CreateOpening ("FunctionalOpening",1,sketchref,plateref)

  part1.Update
  ...

Retrieving the Factory and Creating an Opening Using the 3D Object Mode

  ...
  'Create Opening Using 3D Object Mode

  Dim Object As AnyObject 
  Set Object =  part1.FindObjectByName("Volume Extrude.1")
  Dim ObjectRef As Reference
  Set ObjectRef = part1.CreateReferenceFromObject(Object)

  Dim OpeningUsing3DObj  As SfmOpening
  Set OpeningUsing3DObj  = Factory. CreateOpening("FunctionalOpening",0,ObjectRef, plateref)

  part1.Update

The created openings are as show below.

[Top]


In Short

This use case has shown how to create opening using the Sketch and the 3D Object mode on a plate.


References

[1] Replaying a Macro
[2] Opening an Existing CATIA Document
[Top]

Copyright © 1999-2011, Dassault Systèmes. All rights reserved.