×
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

Number on Instances in an assembly

Number on Instances in an assembly

Number on Instances in an assembly

(OP)
Hi everyone,

I have to calculate the inertia Matrix of all CATParts with in a Product, in oder to improve the calculation time, and since many parts could have many instances. I would like to calculate the inertia matrix just once and not more times if its actually the same Part. Is there a way to know how many different parts do I have in the assembly (I mean, not taking in consideration the instances) and from these Parts to know wich ones have instances and how many do they have??

Thanks in Advance

RE: Number on Instances in an assembly

Hi,

I will let you to develop, is just an example in a CATScript....

Sub CATMain()

Set oPartDocument = CATIA.ActiveDocument
Set oSelection = oPartDocument.Selection
Dim oInputType(0)
Dim oStatus

MsgBox "Select a Part in the SPECIFICATION TREE"

oInputType(0) = "AnyObject"
oStatus = oSelection.SelectElement2(oInputType, "Select a Part", True)
If (oStatus = "Cancel") Then
Exit Sub
End If
Set mySelection = oSelection.Item(1).Value

Dim input
Dim sLF
Dim arrayOfVariantOfBSTR1(0)

'~ '-----------------------------
sLF = Chr(10)

 input = InputBox ("This is the input for search Part Number", "Finder", left(mySelection.Name, len(mySelection.Name) -2))

If input = "" Then
    Exit Sub
End If

   Set productDocument1 = CATIA.ActiveDocument
    Set selPN = productDocument1.Selection
 
    selPN.Search "'Assembly Design'.Product.'Part Number'=" & input & ",all"
    CATIA.StartCommand "Center graph"

     If (CATIA.ActiveDocument.Selection.Count) > 0 Then

       For i = 1 To CATIA.ActiveDocument.Selection.Count ' For each element...

       Next
     End If

  MsgBox   " Selected Elements " & i-1
     

End Sub

  

Regards
Fernando
cadromania.net - Romanian CAD forums

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