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!

Catia Macro filtering

Status
Not open for further replies.

Sushimon

Aerospace
Nov 16, 2012
2
Hi,

I need some help filtering off some CATPARTS.
I want to filter it out by the partname but when i use the * which i thought was a wildcard, Catia doesn't seem to like it the line and doesn't apply the rest of the code. Here's an example:

If objPartDocument.name = ("Multi*.CATPart") then
msgbox objPartDocument.name
Else
End if

Could someone help me out with this? thanks so much!


 
Replies continue below

Recommended for you

Hi,

If you have few parts starting with Multi* , do a search using name as search criteria, include them in a collection, then extract the name for each item in collection.

To understand more about what you want, we should see a little bit more from your code but I suppose you want what I already wrote above.

Are you coding in vba , catscripr or ? For what are you using this filter ? To open parts or do something else ? Hope you understood my point.

Regards
Fernando

 
Hi Ferdo,

I'm working in VB. I'm just trying to filter some of the parts off so it doesn't get shown

Sub CATMain()

Dim doc1 As documents
Dim docName As String
Dim objDocumentPart As PartDocument
Dim i As Integer

Set documents = CATIA.documents

For i = 1 To doc1.Count
docName = TypeName(doc1.Item(i))
If docName = "PartDocument" Then
Set objDocumentPart = doc1.Item(i)
'I want to filter the names of the objDocumentPart.name here to only show certain part docs
Msgbox objDocumentPart.name
Next
End if
End Sub







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor