Structure Detail Design

Editing Plates


This macro shows you how to modify existing plates and advanced plates. This macro modifies the existing plates created using the CAASddCreatePlate macro.

CAASddEditPlate is launched in CATIA [1]. First open CAASddEditPlate.CATPart in the samples directory.

CAASddEditPlate.CATScript is located in the CAAScdSddUseCases. Execute macro (Windows only).

CAASddEditPlate includes nine steps:

  1. Prolog
  2. Retrieving the Factory from the Part Document
  3. Getting the Manager from the Factory
  4. Retrieving the Super Plates
  5. Retrieving the Split Plates of the Seamed Shell Super Plate
  6. Modifying the Split Plates Retrieved (Child Plate)
  7. Retrieving and Modifying the Deck Plate
  8. Retrieving and Modifying the Transverse Bulkhead
  9. Updating the Part Document

Edit Plates

Prolog

Opens the CAASddEditPlate.CATPart in CATIA.

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

Retrieving the Factory from the Part Document

This step describes how to get Structure Functional Modeler factory object.

  ...
  'Get the Factory Object
  Dim FactoryObj As SfmFactory
  Set FactoryObj = ObjPart.GetCustomerFactory("SfmFactory")
  ...

Getting the Manager from the Factory

This step describes how to get the SfmManager object.

  ...
  'Get the Manager Object
  Dim ManagerObj  As  SfmManager
  Set ManagerObj = FactoryObj.GetManager
  ...

Retrieving the Super Plates

This step describes how to get the plate collection and how to get one specific item in it.

  ...
 'RETRIEVING THE SUPERPLATES
  Dim SuperPlates As References
  Set SuperPlates = ManagerObj.GetSuperPlates
  Dim ShellSuperPlate1, ShellSuperPlate2, DeckSuperPlate, TBHSuperPlate As SfmSuperPlate
  Set ShellSuperPlate1 = SuperPlates.Item(1)
  Set ShellSuperPlate2 = SuperPlates.Item(2)
  Set DeckSuperPlate = SuperPlates.Item(3)
  Set TBHSuperPlate = SuperPlates.Item(4)
  ...

Retrieving the Split Plates of the Seamed Shell Super Plate

This step describes how to get the child split plate of ShellSuperPlate1.

  ...
  'Retrieving the SplitPlates of ShellSuperPlate
  Dim ShellSplitPlateRefs As References
  Set ShellSplitPlateRefs = ShellSuperPlate1.SplitPlates
  Dim ShellSplitPlateRef1, ShellSplitPlateRef2 As Reference
  Set ShellSplitPlateRef1 = ShellSplitPlateRefs.Item(1)
  Set ShellSplitPlateRef2 = ShellSplitPlateRefs.Item(2)

  'Getting Selection Object
  Set SelectionObj = CATIA.ActiveDocument.Selection

  'Adding SplitPlate(as Reference) to Selection Object
  SelectionObj.Add ShellSplitPlateRef1

  'To get SplitPlate1 As SfmSuperPlate
  Dim ShellSplitPlate1 As SfmSuperPlate
  Set ShellSplitPlate1 = SelectionObj.FindObject("CATIASfmSuperPlate")
  ...

Modifying the Split Plates Retrieved (Child Plate)

First, we are retrieving the thickness, material, and grade of the child plate, and then we modify them.

  ...
  'Retrieving and Modifying the Attributes of Child Plate
  Dim Thickness1 As Double
  Dim material1 As String
  Dim grade1 As String
  ShellSplitPlate1.GetSplitPlateAttributes 1, Thickness1, material1, grade1
  ShellSplitPlate1.SetSplitPlateAttributes 1, 30, "Steel", "A42"
  ...

Retrieving and Modifying the Deck Plate

  ...
  SelectionObj.Add DeckSuperPlate
  Dim DeckPlate As SfmSuperPlate
  Set DeckPlate = SelectionObj.FindObject("CATIASfmSuperPlate")
  'Retrieving SuperPlate's Support
  Dim DeckSupport As Reference
  Set DeckSupport = DeckPlate.Support
  'Setting and Retrieving the SuperPlate's support offset
  DeckPlate.SupportOffSet = "30.0"
  Dim DeckSupportOffSet As Double
  DeckSupportOffSet = DeckPlate.SupportOffset
  'Retrieving the SuperPlate's limit mode
  Dim LimitMode As Long
  LimitMode = DeckPlate.LimitMode
  'Retrieving the Limits Of SuperPlate
  Dim DeckPlateLimits As References
  Set DeckPlateLimits = DeckPlate.Limits
  ...

Retrieving and Modifying the Transverse Bulkhead

  ...
  'EDITING THE TRANSVERSE BULKHEAD SUPERPLATE
  SelectionObj.Add TBHSuperPlate
  Dim TBHPlate As SfmSuperPlate
  Set TBHPlate = SelectionObj.FindObject("CATIASfmSuperPlate")

  'Getting Limits Of SuperPlate
  Dim TBHPlateLimits As References
  Set TBHPlateLimits = TBHPlate.Limits

  'Setting 2nd Limit As Last Limit
  TBHPlate.SetAsLastLimit (2)
  'Adding One More Limit
  Dim TBHPlateNewLimit As AnyObject
  Set TBHPlateNewLimit = ObjPart.FindObjectByName("LONG.5")
  Dim TBHPlateNewLimitRef As Reference
  Set TBHPlateNewLimitRef = ObjPart.CreateReferenceFromObject(TBHPlateNewLimit)
  Dim TBHPlateNewOrnt As Long
  TBHPlateNewOrnt = 4
  TBHPlate.AddLimit TBHPlateNewLimitRef, TBHPlateNewOrnt

  'Inverting the limit orientation of 4th Limit
  TBHPlate.InvertLimit (4)
  'Retrieving and Modifying the Support of SuperPlate
  Dim TBHPlateSupport As Reference
  Set TBHPlateSupport = TBHPlate.Support
  Dim TBHPlateNewSupport As AnyObject
  Set TBHPlateNewSupport = ObjPart.FindObjectByName("CROSS.100")
  Dim TBHPlateNewSupportRef As Reference
  Set TBHPlateNewSupportRef = ObjPart.CreateReferenceFromObject(TBHPlateNewSupport)
  
  TBHPlate.Support = TBHPlateNewSupportRef
   
  'To get Category
  Dim TBHPlateCategory As String
  TBHPlateCategory = TBHPlate.Category

  'Retrieving and Modifying the thickness, material, grade of SuperPlate
  Dim TBHPlateThickness As Double
  TBHPlateThickness = TBHPlate.Thickness
  Dim TBHPlateMaterial, TBHPlateGrade As String
  TBHPlateMaterial = TBHPlate.Material
  TBHPlateGrade = TBHPlate.Grade
  
  TBHPlate.Material = "Steel"
  TBHPlate.Grade = "A45"
  TBHPlate.Thickness = "35.0"
 ...

Updating the Part Document

The Part has to be updated to generate the geometrical representations of the modified objects. Once this done, the updated objects are visible in the 3D window and in the specification tree.

 ...
  'Updating the Part with all modifications
  ObjPart.Update
End Sub

[Top]


In Short

This use case has shown how to edit plate objects.


References

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

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