Continue to Site

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!

Number on Instances in an assembly

Status
Not open for further replies.

camahiahua

Automotive
Nov 16, 2010
4
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
 
Replies continue below

Recommended for you

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor