For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

2D VS 2008 complete example

State Gabriel Mihai's picture


I need a complete example in VB.NET or C# of how to embedd OCC viewer into my application in order to draw some 2d entities or to open a vector file.

Thanks in advance.

State Gabriel Mihai's picture

nevermind I've done it!

Below is the piece of code:

Private Sub Create2DView()
Dim device As OCWNT_GraphicDevice = New OCWNT_GraphicDevice(True, Me.Handle)
Dim aWindow As OCWNT_Window = New OCWNT_Window(device, Me.Handle, OCQuantity_NameOfColor.Quantity_NOC_BLACK)
Dim driver As OCWNT_WDriver = New OCWNT_WDriver(aWindow)
Dim gView As New OCGraphic2d_View
Dim viewer As New OCV2d_Viewer(device, gView, "Visu2d", "")
Dim view As OCV2d_View = New OCV2d_View(driver, viewer, 250, 250, 500)
End Sub