 |
CAASddCreatePlate includes eleven steps:
- Prolog
- Retrieving the Factory from the Part Document
- Getting the Manager from the Factory
- Adding a Hull
- Creating a Shell Plate by Defining the Support
- Adding Limits to the Shell Plate
- Generating Geometry for the Shell Plate
- Creating a Shell Plate on PortSide
- Creating a Deck Plate
- Creating an Advanced Transverse Bulkhead Plate
- Updating the Part Document
Opens the CAASddCreatePlate.CATPart in CATIA.
Sub CATMain()
Dim ObjPart As Part
Set ObjPart = CATIA.ActiveDocument.Part
...
|
This Step describes how to get Structure Functional Modeler factory. The
SfmFactory object will be used for creating Structure Functional Modeler objects.
...
Dim FactoryObj As SfmFactory
Set FactoryObj = ObjPart.GetCustomerFactory("SfmFactory")
...
|
The Manager object is obtained by the GetManager method.
...
Dim ManagerObj As SfmManager
Set ManagerObj = FactoryObj.GetManager
...
|
A hull is added to current part.
...
ManagerObj.AddHull
...
|
...
Dim ShellSupport As AnyObject
Set ShellSupport = ObjPart.FindObjectByName("Hull1234")
Dim ShellSupportRef As Reference
Set ShellSupportRef = ObjPart.CreateReferenceFromObject(ShellSupport)
Dim ShellSuperplate1 As SfmSuperPlate
Set ShellSuperplate1 = FactoryObj.AddSuperPlate("ShellPanel", ShellSupportRef, Nothing)
...
|
Add limits to the shell plate by selecting a reference. Also, define orientation
of the limit, so As to keep desired side.
...
Dim ShellPlateLimit1 As AnyObject
Set ShellPlateLimit1 = ObjPart.FindObjectByName("CROSS.40")
Dim ShellPlateLimitRef1 As Reference
Set ShellPlateLimitRef1 = ObjPart.CreateReferenceFromObject(ShellPlateLimit1)
Dim ShellPlateOrnt1 As Long
ShellPlateOrnt1 = 8
ShellSuperplate1.AddLimit ShellPlateLimitRef1, ShellPlateOrnt1
Dim ShellPlateLimit2 As AnyObject
Set ShellPlateLimit2 = ObjPart.FindObjectByName("CROSS.140")
Dim ShellPlateLimitRef2 As Reference
Set ShellPlateLimitRef2 = ObjPart.CreateReferenceFromObject(ShellPlateLimit2)
Dim ShellPlateOrnt2 As Long
ShellPlateOrnt2 = 9
ShellSuperplate1.AddLimit ShellPlateLimitRef2, ShellPlateOrnt2
Dim ShellPlateLimit3 As AnyObject
Set ShellPlateLimit3 = ObjPart.FindObjectByName("LONG.0")
Dim ShellPlateLimitRef3 As Reference
Set ShellPlateLimitRef3 = ObjPart.CreateReferenceFromObject(ShellPlateLimit3)
Dim ShellPlateOrnt3 As Long
ShellPlateOrnt3 = 5
ShellSuperplate1.AddLimit ShellPlateLimitRef3, ShellPlateOrnt3
...
|
To generate geometry, build is done for Shell Plate by Run.
...
ShellSuperplate1.Run
...
|
...
Dim ShellSuperplate2 As SfmSuperPlate
Set ShellSuperplate2 = FactoryObj.AddSuperPlate("ShellPanel", ShellSupportRef, Nothing)
Dim ShellPlate2Limit1 As AnyObject
Set ShellPlate2Limit1 = ObjPart.FindObjectByName("CROSS.40")
Dim ShellPlate2LimitRef1 As Reference
Set ShellPlate2LimitRef1 = ObjPart.CreateReferenceFromObject(ShellPlate2Limit1)
Dim ShellPlate2Ornt1 As Long
ShellPlate2Ornt1 = 8
ShellSuperplate2.AddLimit ShellPlate2LimitRef1, ShellPlate2Ornt1
Dim ShellPlate2Limit2 As AnyObject
Set ShellPlate2Limit2 = ObjPart.FindObjectByName("CROSS.140")
Dim ShellPlate2LimitRef2 As Reference
Set ShellPlate2LimitRef2 = ObjPart.CreateReferenceFromObject(ShellPlate2Limit2)
Dim ShellPlate2Ornt2 As Long
ShellPlate2Ornt2 = 9
ShellSuperplate2.AddLimit ShellPlate2LimitRef2, ShellPlate2Ornt2
Dim ShellPlate2Limit3 As AnyObject
Set ShellPlate2Limit3 = ObjPart.FindObjectByName("LONG.0")
Dim ShellPlate2LimitRef3 As Reference
Set ShellPlate2LimitRef3 = ObjPart.CreateReferenceFromObject(ShellPlate2Limit3)
Dim ShellPlate2Ornt3 As Long
ShellPlate2Ornt3 = 4
ShellSuperplate2.AddLimit ShellPlate2LimitRef3, ShellPlate2Ornt3
ShellSuperplate2.Run
...
|
Create a deck plate on the Deck.3 plane As support,
and then limit it by the shell plates CROSS.40 and CROSS.140.
...
Dim DeckSupport As AnyObject
Set DeckSupport = ObjPart.FindObjectByName("DECK.3")
Dim DeckSupportRef As Reference
Set DeckSupportRef = ObjPart.CreateReferenceFromObject(DeckSupport)
Dim DeckSuperplate As SfmSuperPlate
Set DeckSuperplate = FactoryObj.AddSuperPlate("DeckPanel", DeckSupportRef, Nothing)
Dim DeckPlateLimit1 As AnyObject
Set DeckPlateLimit1 = ObjPart.FindObjectByName("CROSS.40")
Dim DeckPlateLimitRef1 As Reference
Set DeckPlateLimitRef1 = ObjPart.CreateReferenceFromObject(DeckPlateLimit1)
Dim DeckPlateOrnt1 As Long
DeckPlateOrnt1 = 2
DeckSuperplate.AddLimit DeckPlateLimitRef1, DeckPlateOrnt1
Dim DeckPlateLimit2 As AnyObject
Set DeckPlateLimit2 = ObjPart.FindObjectByName("CROSS.140")
Dim DeckPlateLimitRef2 As Reference
Set DeckPlateLimitRef2 = ObjPart.CreateReferenceFromObject(DeckPlateLimit2)
Dim DeckPlateOrnt2 As Long
DeckPlateOrnt2 = 3
DeckSuperplate.AddLimit DeckPlateLimitRef2, DeckPlateOrnt2
Dim DeckPlateOrnt3 As Long
DeckPlateOrnt3 = 8
DeckSuperplate.AddLimit ShellSupportRef, DeckPlateOrnt3
Dim DeckPlateObj As SfmObject
Set DeckPlateObj = DeckSuperplate
DeckPlateObj.Material = "Steel"
DeckPlateObj.Grade = "A45"
DeckSuperplate.Thickness = "25.0"
DeckSuperplate.Run
...
|
...
Dim TrnsPlateSupport As AnyObject
Set TrnsPlateSupport = ObjPart.FindObjectByName("CROSS.90")
Dim TrnsPlateSupportRef As Reference
Set TrnsPlateSupportRef = ObjPart.CreateReferenceFromObject(TrnsPlateSupport)
Dim TrnsSuperplate As SfmSuperPlate
Set TrnsSuperplate = FactoryObj.AddAdvSuperPlate("TransversePanel", TrnsPlateSupportRef, Nothing)
Dim TrnsPlateLimitRef1 As Reference
Set TrnsPlateLimitRef1 = ObjPart.CreateReferenceFromObject(ShellSuperplate1)
Dim TrnsPlateOrnt1 As Long
TrnsPlateOrnt1 = 4
TrnsSuperplate.AddLimit TrnsPlateLimitRef1, TrnsPlateOrnt1
Dim TrnsPlateLimitRef2 As Reference
Set TrnsPlateLimitRef2 = ObjPart.CreateReferenceFromObject(ShellSuperplate2)
Dim TrnsPlateOrnt2 As Long
TrnsPlateOrnt2 = 5
TrnsSuperplate.AddLimit TrnsPlateLimitRef2, TrnsPlateOrnt2
Dim TrnsPlateLimitRef3 As Reference
Set TrnsPlateLimitRef3 = ObjPart.CreateReferenceFromObject(DeckSuperplate)
Dim TrnsPlateOrnt3 As Long
TrnsPlateOrnt3 = 7
TrnsSuperplate.AddLimit TrnsPlateLimitRef3, TrnsPlateOrnt3
TrnsSuperplate.Run
...
|
Update the Part.
...
ObjPart.Update
End Sub
|
|