×
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 macro to get rotation axis?

Catia macro to get rotation axis?

Catia macro to get rotation axis?

(OP)
Hello everyone,

I have an assembly with two parts that are linked by a revolute joint. I want to write a macro to get the orientation of the revolution axis?

Any idea how to do that?

Thanks!

RE: Catia macro to get rotation axis?

(OP)
Wow, I still don't know how to do this.

So if by chance someone knew, I would be very interested how I could accomplished that directly or indirectly...

Thanks

RE: Catia macro to get rotation axis?

here is the axis of the coincidence:

CODE --> catvba

Sub CATMain()

    Dim oDoc As Document
    Set oDoc = CATIA.ActiveDocument

    Dim oProd As Product
    Set oProd = oDoc.Product

    Dim oConstraintsCol As Constraints
    Set oConstraintsCol = oProd.Connections("CATIAConstraints")

    Dim oCoincid As Constraint
    Set oCoincid = oConstraintsCol.Item(2) ' I have a fix as the first constraint

    Dim oRef1 As Reference
    Set oRef1 = oCoincid.GetConstraintElement(1) ' get first element of the coicidence

    oDoc.Selection.Clear
    oDoc.Selection.Add oRef1 ' just for fun

    Dim TheSPAWorkbench As Workbench
    Set TheSPAWorkbench = oDoc.GetWorkbench("SPAWorkbench")

    Set TheMeasurable = TheSPAWorkbench.GetMeasurable(oRef1)

    Dim aAxisVector(2)

    TheMeasurable.GetDirection aAxisVector

    MsgBox (" vector of coincidence = " _
        & aAxisVector(0) & "," & aAxisVector(1) & "," & aAxisVector(2))


    oDoc.Selection.Clear

    End Sub 

Eric N.
indocti discant et ament meminisse periti

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