Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

CATIA V5 - Composite Design exposed to automation?

Status
Not open for further replies.

skhan547

Aerospace
May 18, 2016
7
CA
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.
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!
 
Replies continue below

Recommended for you

I have been searching for composites coding for a long time. Seems like it's not exposed to VB (for users like us). I asked our Catia V5 support in Israel but got no answer for my request. Have to give them a reminder.

Thanks for posted code. Stacking and everything inside it works exactly like Geo. sets. Yo can also move stacking review wherever you want.
 
Jenial,

Thanks for your reply! A pity to hear it isn't exposed. If you hear anything from your support rep, please let the community know!

Do you know of anything else in composites workbench that can be accessed, even with workarounds?
 
I know nothing that can be exposed..Even simple command such as expand stacking tree cannot be recorded. Since our support knows nothing about scripting this will be a long way to find out about automation in composites workbench.
 
Hi all
I am also interested in this topic. I know that something can be done, since custom commands and tools that interface with Composites workbench do exist on the market. Perhaps, as Jenial says, not for "users like us".
To the standard VB scripting interface, entities related to CPX are totally obscure. By querying them with my script that writes out Type and checks for geometry class, it says
1_gs8ypq.jpg
for a ply
and
2_eeetuh.jpg
for a Contour. Note the reading of HybridShapeThickness, which is a Part design's THickness command. It has no sense.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top