Structure Functional Design

Editing Standard Openings


This macro shows you how to edit openings.

CAASfdEditStdOpening is launched in CATIA [1]. First open CAASfdCreateOpening.CATPart in the samples directory. The macro first creates openings using the Offset-Offset strategy. This is not described here.

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

CAASfdEditStdOpening includes three steps:

  1. Prolog
  2. Editing the Contour
  3. Editing the Position

Prolog

Opens the CAASfdEditStdOpening.CATPart in CATIA and create the openings. See Creating Standard Openings and the CAASfdOffset_Offset.CATScript macro.

Sub CATMain()
  Dim part1 As Part
  Set part1 = CATIA.ActiveDocument.Part
  ...

Editing the Contour

  ...
  Dim GetName As String
  Dim GetParam As SfmStandardContourParameters

  StdOpening.GetContour GetName, GetParam

  Dim Nb As Long
  Nb = GetParam.Count

  Dim ParamName1 As String
  Dim ParamValue1 As Parameter

  For i = 1 To Nb
    Set ParamValue1 = GetParam.Item(i)
    ParamName1 = ParamValue1.Name

    If ParamName1 = "Sfm_Width" Then
      ParamValue1.ValuateFromString ("1000mm")
    End If
    If ParamName1 = "Sfm_Height" Then
      ParamValue1.ValuateFromString ("1000mm")
    End If
    If ParamName1 = "Sfm_CornerRadius" Then
      ParamValue1.ValuateFromString ("25mm")
    End If
  Next

  StdOpening.SetContour GetName, GetParam  ...

Editing the Position

  ...
  Dim pName As String
  Dim pStrategyParams As SfmStandardPosStrategyParameters
  StdOpening.GetPositioningStrategy pName, pStrategyParams

  Dim UrefNew As Reference
  Set UrefNew = Part1.FindObjectByName("CROSS.70")

  Dim URefListint1 As SfmReferences
  Set URefListint1 = Factory.SfmReferences
  URefListint1.Add UrefNew

  pStrategyParams.SetPosParamData "CATSfmPosOffsetOffset", 40, URefListint1, 25, VrefList, 30

  StdOpening.SetPositioningStrategy pName, pStrategyParams

  part1.Update  ...

[Top]


In Short

This use case has shown how to edit standard openings.


References

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

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