Hello all! First post, so let me thank you for your help in my learning up until now. I'm an intern whose job is almost exclusively CATIA programming, and most of my CATIA specific coding knowledge comes from posts on here!
I've been using CATIA's Composite Design workbench (CPX & CGX), and have found that most operations within that workbench aren't exposed to automation. As an example, a simple operation; Adding Plygroups, sequences, and plies.
Below is the only code I've managed to pull from the recorder and modify.
Things I have tried (searched through):
[ul]
[li]V5 Automation.chm[/li]
[li]Recording macros in VBA Module, catvbs, and CATScript. None resulted in very useful material, except that I can access plygroups and stacking as HybridBodies, but cannot create (Add()) them except as Geometrical Sets... (shown above)[/li]
[li]The internet, where nobody seems to specifically have questions about coding in this workbench. Or my search parameters are wrong. This & this are the only posts I've found.[/li]
[/ul]
Please prove me wrong and show me what resource I'm missing. I'd love to be able to automate our workflow within this workbench as well!
I've been using CATIA's Composite Design workbench (CPX & CGX), and have found that most operations within that workbench aren't exposed to automation. As an example, a simple operation; Adding Plygroups, sequences, and plies.
Below is the only code I've managed to pull from the recorder and modify.
Code:
Sub CATMain()
'Code to declare certain plies/sequences as the InWork Object.
Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies
Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Item("Stacking")
Dim hybridBodies2 As HybridBodies
Set hybridBodies2 = hybridBody1.HybridBodies
'Up til here is necessary. Assumption is that 'Stacking' HybridBody exists as a CATIA internal (reserved) name.
Dim hybridBody2 As HybridBody
Set hybridBody2 = hybridBodies2.Item("Plies Group.1")
Dim hybridBodies3 As HybridBodies
Set hybridBodies3 = hybridBody2.HybridBodies
Dim hybridBody3 As HybridBody
Set hybridBody3 = hybridBodies3.Item("Sequence.1")
Dim hybridBodies4 As HybridBodies
Set hybridBodies4 = hybridBody3.HybridBodies
Dim hybridBody4 As HybridBody
Set hybridBody4 = hybridBodies4.Item("Sequence.2")
Dim hybridBodies5 As HybridBodies
Set hybridBodies5 = hybridBody4.HybridBodies
Dim hybridBody5 As HybridBody
Set hybridBody5 = hybridBodies5.Item("Ply.1")
part1.InWorkObject = hybridBody5
part1.InWorkObject = hybridBody4
End Sub
Things I have tried (searched through):
[ul]
[li]V5 Automation.chm[/li]
[li]Recording macros in VBA Module, catvbs, and CATScript. None resulted in very useful material, except that I can access plygroups and stacking as HybridBodies, but cannot create (Add()) them except as Geometrical Sets... (shown above)[/li]
[li]The internet, where nobody seems to specifically have questions about coding in this workbench. Or my search parameters are wrong. This & this are the only posts I've found.[/li]
[/ul]
Please prove me wrong and show me what resource I'm missing. I'd love to be able to automate our workflow within this workbench as well!