Showing results for 
Search instead for 
Did you mean: 

SHOW/HIDE Occurrences in Draft

Valued Contributor
Valued Contributor


I've been asked to create a program to HIDE specific occurrences in a specific drawing view based on a selection provided by user input. For example, if there are 100 screws in an assembly, and in one particular view, the user wished to hide 1 or 2 particular occurences, it is very time consuming to track down which occurrence to hide. So, I see a program that functions as suchSmiley Tonguerompt user via Status Bar to select an edge/arc/line contained in the occurrence wishing to be blankedBased on user selection, identify Drawing View that contains the item selectedBased on Drawing View, identify occurence that edge/arc/line belongs toMark occurrence as Show = False

Is there a way to create a selection set as needed above?



Posted by: Bill Ledbetter
Post date: 10/4/2007 4:56:40 AM


RE: SHOW/HIDE Occurrences in Draft

Valued Contributor
Valued Contributor



Can you do that kind of SmartSelect inside of Solid Edge on a DrawingView? I've tried and can't figure it out. I'm asking because "usually", if you can do it in Solid Edge, you can do it programatically.


I see where we can set the visibility of the items:


Application -> ActiveDocument -> ActiveSheet -> DrawingViews -> Items -> DrawingView -> ModelMembers -> Items -> ModelMember -> ...


using the DisplayType.


So the only real question is can we select a particular occurrence inside the DrawingView.


Posted by: Jason Newell
Post date: 10/4/2007 11:19:37 AM

RE: SHOW/HIDE Occurrences in Draft

Valued Contributor
Valued Contributor

Hi Jason,


Yes, I already saw where it was exposed via SESPY, but my problem is as you mentioned. I have to use a mouse event to capture the item, but it doesn't pre-highlight it, so it makes it hard for the user to identify what he is clicking.


I'll post if I find a solution.


- Bill


Posted by: Bill Ledbetter
Post date: 10/5/2007 1:32:19 AM

RE: SHOW/HIDE Occurrences in Draft

Valued Contributor
Valued Contributor



I've had a quick look and lashed the following together (vb6), its not very pretty but it seems to do what you want. Just pop a command button on a form and add references to SE.

Let me know if its what you were after.


Option Explicit



Dim m_SEApplication As SolidEdgeFramework.Application

Dim g_SEDraft As SolidEdgeDraft.DraftDocument

Dim g_seLastObjectSelected As Object


Public WithEvents g_SEcommand As SolidEdgeFramework.Command

Public WithEvents g_SEMouseEvents As SolidEdgeFramework.Mouse


       Sub FilterSelection()


        Set g_SEcommand = m_SEApplication.CreateCommand(SolidEdgeConstants.seCmdFlag.seNoDeactivate)

        Set g_SEMouseEvents = g_SEcommand.Mouse


        Call g_SEcommand.Start

        g_SEMouseEvents.LocateMode = SolidEdgeConstants.seLocateModes.seLocateSimple

        g_SEMouseEvents.DynamicsMode = SolidEdgeConstants.seDynamicsModes.seDynamicsOff

        Call g_SEMouseEvents.ClearLocateFilter

    End Sub



Private Sub Command1_Click()


    'Get SE object

    Set m_SEApplication = GetObject(, "SolidEdge.Application")

    Set g_SEDraft = m_SEApplication.ActiveDocument

    Call FilterSelection

End Sub


Private Sub g_SEMouseEvents_MouseDown(ByVal sButton As Integer, ByVal sShift As Integer, ByVal dX As Double, ByVal dY As Double, ByVal dZ As Double, ByVal pWindowDispatch As Object, ByVal lKeyPointType As Long, ByVal pGraphicDispatch As Object)


Dim p_seElement As Object


'On Error Resume Next


        ' Check that we have selected something

        If Not (pGraphicDispatch Is Nothing) Then



                ' Assign our selected element to our

                Set p_seElement = pGraphicDispatch

                ' Remove everything from the current select set

                Call g_SEDraft.SelectSet.RemoveAll

                ' Add the seleted item to the select set

                'g_SEDraft.SelectSet.Add (pGraphicDispatch)


                Set g_seLastObjectSelected = p_seElement

                ' Get the parent e.g. the drawing view

                MsgBox p_seElement.ImmediateParent.Name


                'MsgBox p_seElement.object.ModelMember.Name

                p_seElement.object.ModelMember.DisplayType = SolidEdgeConstants.ModelMemberDisplayTypeConstants.seHidePart


        End If

End Sub


Posted by: James Singleton
Post date: 10/8/2007 8:11:41 AM