Catia Macro filtering
Catia Macro filtering
(OP)
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!
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!





RE: Catia Macro filtering
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
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Catia Macro filtering
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
RE: Catia Macro filtering
If you still have problems, please post the code here. In my opinion, what you have up to now is not a good start for what you want to do.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...