Hello,
I hope you can help me.
I want to create a configurator. The user should select from an existing product, for him relevant submodels on the Userform which are loaded after confirming the OK button in a new product.
How is it possible to match the name of the submodel with a search name?
For example the part model is called "Test_0.0.01." the search term would be e.g. "Test". If the search term matches the name of the submodel, the model is selected.
Unfortunately, the function (selection1.Search) does not help me, because the previous selection will be removed in a new search. However, I would like to search for several models at the same time and select and then copy and paste them into a new product.
I recorded that with the macro recorder.
Thank you very much
Hansi001
I hope you can help me.
I want to create a configurator. The user should select from an existing product, for him relevant submodels on the Userform which are loaded after confirming the OK button in a new product.
How is it possible to match the name of the submodel with a search name?
For example the part model is called "Test_0.0.01." the search term would be e.g. "Test". If the search term matches the name of the submodel, the model is selected.
Unfortunately, the function (selection1.Search) does not help me, because the previous selection will be removed in a new search. However, I would like to search for several models at the same time and select and then copy and paste them into a new product.
I recorded that with the macro recorder.
Code:
If CB_TEST = True Then
Dim productDocument1 As ProductDocument
Set productDocument1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = productDocument1.Selection
'selection1.Clear
Dim product1 As Product
Set product1 = productDocument1.Product
Dim products1 As Products
Set products1 = product1.Products
Dim product2 As Product
Set product2 = products1.Item("ZSB TEST 000.0.1")
Dim products2 As Products
Set products2 = product2.Products
Dim product3 As Product
Set product3 = products2.Item("Modell-V5 TEST 000.0.1")
Dim products3 As Products
Set products3 = product3.Products
Dim product19 As Product
Set product19 = products3.Item("TEST 000.0.1")
selection1.Add product19
Else
selection1.Remove (product19)
End If
Thank you very much
Hansi001