Create a new 2D request

Creator
Creator

Hi

 

I need your help to realse this specification

 

I want to do a program (only one function) who use a new request 2D for select a modelmember. This request must be create by the function.

 

I know use an existing request but I cannot create a new request for using with API.

 

Have you a solution for me ?

See a picture with this post for more explications.

 

Best regards

2 REPLIES

Re: Create a new 2D request

Creator
Creator

Sorry

 

I reword my request with this example :

 

1/ possible program to request a DFT view
###########################################################################
' ### Using ExecuteQuery
' ###   - The request must exist in the DFT
' ###   - The result must be use in the loop ModelMember after ModelMember. It's so slow
###########################################################################
        Try

            Dim objActiveDocumentDft As SolidEdgeDraft.DraftDocument = objApplication.ActiveDocument
            Dim DrawingView As SolidEdgeDraft.DrawingView = objActiveDocumentDft.SelectSet.Item(1)

            Dim objModelMembers As SolidEdgeDraft.ModelMembers = Nothing


            objModelMembers = DrawingView.ExecuteQuery("SavedQuery")

            If objModelMembers.Count > 0 Then
                Dim objModelMember As SolidEdgeDraft.ModelMember = Nothing


                For Each objModelMember In objModelMembers
                    objModelMember.DisplayAsReference = True
                    ' Le fait de devoir effectuer cette boucle cause de gros problèmes de performance sur les gros DFT lors de modifs graphiques importantes.
                Next

            End If

        Catch ex As Exception
        End Try
        ' -----------------------------------------------------------------------------------------------------

 

 

 

 

 

 

 

 

I want a program like this for quering on DFT view
###########################################################################
 ' #  This program is an exemple. It does not work
###########################################################################
        Try

            Dim objActiveDocumentDft As SolidEdgeDraft.DraftDocument = objApplication.ActiveDocument
            Dim DrawingView As SolidEdgeDraft.DrawingView = objActiveDocumentDft.SelectSet.Item(1)

            Dim objModelMembers As SolidEdgeDraft.ModelMembers = Nothing

            DrawingView.QuickQuery.RemoveAllCriteria()
            DrawingView.QuickQuery.Scope = SolidEdgeAssembly.QueryScopeConstants.seQueryScopeSelectedParts
            DrawingView.QuickQuery.SearchSubassemblies = True
            DrawingView.QuickQuery.LoadSubassemblies = False
            DrawingView.QuickQuery.AddCriteria(SolidEdgeAssembly.QueryPropertyConstants.seQueryPropertyCustom, _
                                    "Layer", _
                                    SolidEdgeAssembly.QueryConditionConstants.seQueryConditionContains, _
                                    "METALLERIE")

            If DrawingView.QuickQuery.MatchesCount > 0 Then
                DrawingView.QuickQuery.ModelMembers.DisplayAsReference = True
                ' -> Besoin de pouvoir exéctuter des modifs sur les Modelmembers en une seule action (comme dans les propriétés de la vue)
            End If

        Catch ex As Exception
        End Try
        ' -----------------------------------------------------------------------------------------------------

 

thanks for your help Smiley Happy

Re: Create a new 2D request

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

Hi,

 

I believe the performance might improve by setting Application.ScreenUpdating to False before entering the for loop to process all found ModelMembers, and resetting to True afterwards.

 

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de