Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
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
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()