 |
CAASfdCreatePlate includes ten 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
- Updating the Part Document
Opens the CAASfdCreatePlate.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.
...
'Get the Factory Object
Dim FactoryObj As SfmFactory
Set FactoryObj = ObjPart.GetCustomerFactory("SfmFactory")
...
|
The Manager object is obtained by the GetManager method.
...
'Get the Manager Object
Dim ManagerObj As SfmManager
Set ManagerObj = FactoryObj.GetManager
...
|
A hull is added to current part.
...
'Adding Hull
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.
...
'Defining First Limit
Dim ShellPlateLimit1 As AnyObject
Set ShellPlateLimit1 = ObjPart.FindObjectByName("CROSS.40")
Dim ShellPlateLimitRef1 As Reference
Set ShellPlateLimitRef1 = ObjPart.CreateReferenceFromObject(ShellPlateLimit1)
'Defining Orientation of First Limit
Dim ShellPlateOrnt1 As Long
ShellPlateOrnt1 = 8
ShellSuperplate1.AddLimit ShellPlateLimitRef1, ShellPlateOrnt1
'Defining Second Limit
Dim ShellPlateLimit2 As AnyObject
Set ShellPlateLimit2 = ObjPart.FindObjectByName("CROSS.140")
Dim ShellPlateLimitRef2 As Reference
Set ShellPlateLimitRef2 = ObjPart.CreateReferenceFromObject(ShellPlateLimit2)
'Defining Orientation of Second Limit
Dim ShellPlateOrnt2 As Long
ShellPlateOrnt2 = 9
ShellSuperplate1.AddLimit ShellPlateLimitRef2, ShellPlateOrnt2
'Defining Third Limit
Dim ShellPlateLimit3 As AnyObject
Set ShellPlateLimit3 = ObjPart.FindObjectByName("LONG.0")
Dim ShellPlateLimitRef3 As Reference
Set ShellPlateLimitRef3 = ObjPart.CreateReferenceFromObject(ShellPlateLimit3)
'Defining Orientation of Third Limit
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.
...
'Defining Support
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)
'Applying Limits
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
'Limiting DeckPlate by ShellPlate
Dim DeckPlateOrnt3 As Long
DeckPlateOrnt3 = 8
DeckSuperplate.AddLimit ShellSupportRef, DeckPlateOrnt3
'SETTING MATERIAL,GRADE AND THICKNESS OF DECKPLATE
Dim DeckPlateObj As SfmObject
Set DeckPlateObj = DeckSuperplate
DeckPlateObj.Material = "Steel"
DeckPlateObj.Grade = "A45"
DeckSuperplate.Thickness = "25.0"
DeckSuperplate.Run
...
|
...
'Defining Support for Transverse Bulkhead Plate
Dim TrnsPlateSupport As AnyObject
Set TrnsPlateSupport = ObjPart.FindObjectByName("CROSS.90")
Dim TrnsPlateSupportRef As Reference
Set TrnsPlateSupportRef = ObjPart.CreateReferenceFromObject(TrnsPlateSupport)
'Creating SuperPlate
Dim TrnsSuperplate As SfmSuperPlate
Set TrnsSuperplate = FactoryObj.AddAdvSuperPlate("TransversePanel", TrnsPlateSupportRef, Nothing)
'Applying Limits
'First Limiting by ShellPlates
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
'Second Limiting by DeckPlate
Dim TrnsPlateLimitRef3 As Reference
Set TrnsPlateLimitRef3 = ObjPart.CreateReferenceFromObject(DeckSuperplate)
Dim TrnsPlateOrnt3 As Long
TrnsPlateOrnt3 = 7
TrnsSuperplate.AddLimit TrnsPlateLimitRef3, TrnsPlateOrnt3
TrnsSuperplate.Run
...
|
The Part has to be updated to generate the geometrical representation
of the created objects. Once this done, the updated objects are visible
in the 3D window and in the specification tree.
...
'To Update CATIA Part Document
ObjPart.Update
End Sub
|
|