×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CATIA V5 - Composite Design exposed to automation?

CATIA V5 - Composite Design exposed to automation?

CATIA V5 - Composite Design exposed to automation?

(OP)
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 --> VBA

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):
  • V5 Automation.chm
  • 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)
  • 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.
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!

RE: CATIA V5 - Composite Design exposed to automation?

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.

RE: CATIA V5 - Composite Design exposed to automation?

(OP)
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?

RE: CATIA V5 - Composite Design exposed to automation?

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.

RE: CATIA V5 - Composite Design exposed to automation?

Quote (skhan547)

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
for a ply
and
for a Contour. Note the reading of HybridShapeThickness, which is a Part design's THickness command. It has no sense.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources