CATIA V5 Automation – How can I filter UserParameters

In the CATIA users can filter their parameters like UserParameters, Renamed Parameters, Visible Parameters and etc.

Like in the photo.
enter image description here

Here my code :

    Products oInstances = oInstance.Products;
    int numberOfInstance = oInstances.Count;
    Product currentProduct;

    KnowledgewareTypeLib.Parameter parameter;
    int numberOfParameters;

    HashSet<string> processedParts = new HashSet<string>();

    Worksheet sheet1 = (Worksheet)workbook.Sheets[1];
    int Kolon = 1;
    int Satir = 1;

    ((Range)sheet1.Cells[Satir, Kolon + 1]).Value2 = "Parametre_Name";
    ((Range)sheet1.Cells[Satir, Kolon + 2]).Value2 = "Parametre_Value";

    if (treeNode == null) { return; }

    if (numberOfInstance == 0)
    {
        return;
    }
    else if (numberOfInstance > 0)
    {
        for (int i = 1; i <= numberOfInstance; i++)
        {
            currentProduct = oInstances.Item(i);

            string partNumber = currentProduct.get_PartNumber();

            if (processedParts.Contains(partNumber))
            {
                continue;
            }

            processedParts.Add(partNumber);

            TreeNode iNode = new TreeNode() { Text = currentProduct.get_Name() };
            treeNode.Nodes.Add(iNode);

            numberOfParameters = currentProduct.Parameters.Count;

            for (int j = 1; j <= numberOfParameters; j++)
            { 
                parameter = currentProduct.Parameters.Item(j);

                if(type == 1)
                {
                    TreeNode jNode = new TreeNode() { Text = parameter.get_Name() + " = " + parameter.ValueAsString() };


                    Range partNameColumn = (Range)sheet1.Cells[Satir , Kolon];
                    partNameColumn.Value2 = parameter.get_Name();

                    Range partValueColumn = (Range)sheet1.Cells[Satir, Kolon + 1];
                    partValueColumn.Value2 = parameter.ValueAsString();

                    Satir++;
                    iNode.Nodes.Add(jNode);
                }

                else if(type == 2)
                {
                    if (parameterList.Contains(parameter.get_Name().Split('\').Last()))
                    {
                        TreeNode jNode = new TreeNode() { Text = parameter.get_Name() + " = " + parameter.ValueAsString() };

                        Range partNameColumn = (Range)sheet1.Cells[Satir, Kolon ];
                        partNameColumn.Value2 = parameter.get_Name();

                        Range partValueColumn = (Range)sheet1.Cells[Satir, Kolon + 1];
                        partValueColumn.Value2 = parameter.ValueAsString();

                        Satir++;
                        iNode.Nodes.Add(jNode);
                    }
                }

                else if(type == 3)
                {
                    return;
                }

            }
            GetParameters(oInstances.Item(i), iNode, workbook, type);
        }
        return;
    }
}

How can i filter this parameters in code. I cant find clear document about it.
I try to check parameter.type() but all parameters type __ComObject and no diffrance in naming.

1

Have a look at this:

Option Explicit

Sub CATMain()
    Dim oDocument As Document                               'Document Anchor
    Dim oPart As Part                                       'Part Anchor
    
    Dim aParam As Parameters                                'Collection of all parameters
    Dim Param As Parameter                                  'Current parameter
    Dim Index As Integer                                    'index
    

    Set oDocument = CATIA.ActiveDocument                    'Anchor document
    Set oPart = oDocument.Part                              'Anchor part

    Set aParam = oPart.Parameters                           'Get parameters
    
    For Index = 1 To aParam.count                           'Loop for all parameters
        Set Param = aParam.Item(Index)                      'Get current Parameter
    
        Debug.Print Param.Name                              'Name/Path of Param
        Debug.Print TypeName(Param)                         'Prints the parameter type to Intermediate window
        Debug.Print "Renamed: " & Param.Renamed             'True if varible was renamed, otherwise false
        Debug.Print TypeName(Param.Context)                 'Prints where the parameter is located. part, product, drawing
        Debug.Print "Hidden: " & Param.Hidden               'True if hidden, outerwise false
        Debug.Print "True Par: " & Param.IsTrueParameter    'True if Real, dimetion, or string; False if isolated point, curve or surface
        Debug.Print "Read only: " & Param.ReadOnly          'True if read only
        
        Select Case Param.UserAccessMode                     'Get acess mode
            Case 0                                                          'Read Only
                Debug.Print "Read only parameter (cannot be destroyed)."
            Case 1                                                          'Read/Write
                Debug.Print "Read/write parameter (cannot be destroyed)."
            Case 2                                                          'User Parameter
                Debug.Print "User parameter (can be read, written and destroyed)."
            Case Else
                Debug.Print "Error getting User acess mode"
        End Select
        
        Debug.Print vbNewLine
        
    Next

End Sub

'---------------------------------------
'
' I ran this on a random part.
' Results for types:
'
'   Parameter
'   RealParam
'   StrParam
'   Length
'   ListParameter
'   IntParam

That are most of the important things that you can get for parameters. Just be carful running the code as it will take a while if there are a lot of parameters, its only supposed to be fore testing.

All the information that you need can be found in:

C:Program FilesDassault SystemesB32win_b64codebinV5Automation.chm

Just search for “KnowledgeInterfaces Parameter (Object)”

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật