cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

how to set drawing view : view Display style ?

psackaraiah
1-Newbie

how to set drawing view : view Display style ?

Following is the code, through which I am setting the needed view display style, which is working fine in the code, no error as well..... but still in drawing view no changes. Can anybody answer this???

Public Sub listViews(ByRef session As IpfcBaseSession, ByVal fileName As String)

        'Dim file As StreamWriter = Nothing

        Dim model As IpfcModel

        Dim drawing As IpfcDrawing

        Dim view2Ds As IpfcView2Ds

        Dim i As Integer

        Dim view2D As IpfcView2D

        Dim viewName As String

        Dim sheetNo As Integer

        Dim solid As IpfcModel

        Dim solidDesc As IpfcModelDescriptor

        Dim outline As CpfcOutline3D

        Dim scale As Double

        Dim viewDisplay As IpfcViewDisplay

        Dim displayStyle As String

        Dim selection As IpfcSelection = Nothing

        Dim selectFeaturesView As IpfcView2D

        Try

            '======================================================================

            'Create file to store information to be displayed

            '======================================================================

            'file = New StreamWriter(fileName)

            'file.WriteLine("<html><head></head><body>")

            '======================================================================

            'Get current model and check that it is a drawing

            '======================================================================

            model = session.CurrentModel

            If model Is Nothing Then

                Throw New Exception("Model not present")

            End If

            If Not model.Type = EpfcModelType.EpfcMDL_DRAWING Then

                Throw New Exception("Model is not drawing")

            End If

            drawing = CType(model, IpfcDrawing)

            view2Ds = drawing.List2DViews

            For i = 0 To view2Ds.Count - 1

                '==================================================================

                'Get information about each view such as name, model

                '==================================================================

                view2D = view2Ds.Item(i)

                'selection.Insert(0, view2Ds.Item(i))

                viewName = view2D.Name

                sheetNo = view2D.GetSheetNumber

                solid = view2D.GetModel

                solidDesc = solid.Descr

                outline = view2D.Outline

                scale = view2D.Scale

                viewDisplay = view2D.Display

              

                view2D.Display.Style = EpfcDisplayStyle.EpfcDISPSTYLE_NO_HIDDEN

                viewDisplay.TangentStyle = EpfcTangentEdgeDisplayStyle.EpfcTANEDGE_DIMMED

                Select Case viewDisplay.Style

                    Case EpfcDisplayStyle.EpfcDISPSTYLE_DEFAULT

                        displayStyle = "default"

                    Case EpfcDisplayStyle.EpfcDISPSTYLE_HIDDEN_LINE

                        displayStyle = "hidden line"

                    Case EpfcDisplayStyle.EpfcDISPSTYLE_NO_HIDDEN

                        displayStyle = "no hidden"

                    Case EpfcDisplayStyle.EpfcDISPSTYLE_SHADED

                        displayStyle = "shaded"

                    Case EpfcDisplayStyle.EpfcDISPSTYLE_WIREFRAME

                        displayStyle = "wireframe"

                End Select

                view2D.Regenerate()

            Next

        Catch ex As Exception

            MsgBox(ex.Message.ToString + Chr(13) + ex.StackTrace.ToString)

        Finally

            'If Not file Is Nothing Then

            '    file.Close()

            'End If

        End Try

    End Sub


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
1 REPLY 1

I've done this to make the view display style update.

Dim newdisplay As IpfcViewDisplay

newdisplay = view2D.Display

newdisplay.Style = EpfcDisplayStyle.EpfcDISPSTYLE_NO_HIDDEN

view2D..Display = newdisplay

view2D.Regenerate()

Top Tags