Structure Functional Design

Creating an SFD System


This macro shows you how to create an SFD System from scratch. This system then can be then used to design SFD features.

CAASfdCreateSFDSystem is launched in CATIA [1]. There is no need to open any Part or Product documents to run this macro.

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

CAASfdCreateSFDSystem includes eleven steps:

  1. Creating a Product Document
  2. Retrieving the Product Root Object from the Product Document
  3. Selecting the Product Document
  4. Adding the Product to the Selection
  5. Getting the SFD Product from the Created Product
  6. Creating the SFD System Part
  7. Retrieving the Factory from the SFD System
  8. Retrieving the Manager from the Factory
  9. Adding the Hull Surface
  10. Creating a Shell Plate using the Hull Surface
  11. Updating the Part Document

Creating a Product Document

Opens the CAASfdCreateSFDSystem.CATPart in CATIA.

Sub CATMain()
  'Create a Product Document
  Dim NewProdDoc As ProductDocument
  Set NewProdDoc = CATIA.Documents.Add("Product")
  ...

Retrieving the Product Root Object from the Product Document

  ...
  'Get the Product from Product Document
  Dim RootPrd As Product
  Set RootPrd = NewProdDoc.Product
  ...

Selecting the Product Document

  ...
  'Select the Product Document
  Dim SelectionObj As Selection
  Set SelectionObj = NewProdDoc.Selection
  ...

Adding the Product to the Selection

  ...
  SelectionObj.Add RootPrd
  ...

Getting the SFD Product from the Created Product

  ...
  'Create a SFD product by finding it in selection
  Dim SfdProductObj As SfdProduct
  Set SfdProductObj = SelectionObj.FindObject("CATIASfdProduct")
  ...

Creating the SFD System Part

  ...
  'Create a SFD System
  Dim sfdpart As Part
  Set sfdpart = SfdProductObj.CreateFunctionalSystem
  ...

Retrieving the Factory from the SFD System

  ...
  'Retrieve the Factory from the SFD System part
  Dim FactoryObj As SfmFactory
  Set FactoryObj = sfdpart.GetCustomerFactory("SfmFactory")
  ...

Retrieving the Manager from the Factory

  ...
  'Retrieve the Manager from the Factory
  Dim ManagerObj As SfmManager
  Set ManagerObj = FactoryObj.GetManager
  ...

Adding the Hull Surface

  ...
  'Add Hull Using Manager
  ManagerObj.AddHull
  ...

Creating a Shell Plate using the Hull Surface

The following script is common to Structure Functional Design and Structure Detail Design.

  ...
  'Define Shell Plate Support
  Dim ShellSupport As AnyObject
  Set ShellSupport = sfdpart.FindObjectByName("Hull1234")
  Dim ShellSupportRef As Reference
  Set ShellSupportRef = sfdpart.CreateReferenceFromObject(ShellSupport)
  
  Dim ShellSuperplate1 As SfmSuperPlate
  Set ShellSuperplate1 = FactoryObj.AddSuperPlate("ShellPanel", ShellSupportRef, Nothing) 

  'Define Limit
  Dim ShellPlateLimit As AnyObject
  Set ShellPlateLimit = sfdpart.FindObjectByName("LONG.0")
  Dim ShellPlateLimitRef As Reference
  Set ShellPlateLimitRef = sfdpart.CreateReferenceFromObject(ShellPlateLimit)
  
  'Define Orientation of Third Limit
  Dim ShellPlateOrnt As Long
  ShellPlateOrnt = 5
  ShellSuperplate1.AddLimit ShellPlateLimitRef, ShellPlateOrnt
  ShellSuperplate1.Thickness = "1.0"
  ShellSuperplate1.Run
  ...

Updating the Part Document

 ...
  'To Updating CATIA Part Document
  sfdpart.Update
End Sub

[Top]


In Short

This use case has shown how to create a SFD System and features inside it.


References

[1] Replaying a Macro
[Top]

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