User
 Forgot password?
 Register
Search
Forum ZWCAD CAD Content
Post time 2018-4-11 05:53:39
Hi

How can I access ZwCAD ProgressMeter in VB.NET
Post time 2018-4-11 16:01:32
Reply 1# siggisal9294


   Hi, using the following code can do that:
   <DllImport("zwcad.exe", CharSet:=CharSet.Unicode, EntryPoint:="?zcedSetStatusBarProgressMeter@@YAHPEB_WHH@Z")> _
    Private Shared Function acedSetStatusBarProgressMeter(label As String, minPos As Integer, maxPos As Integer) As Integer
    End Function
    <DllImport("zwcad.exe", CharSet:=CharSet.Unicode, EntryPoint:="?zcedSetStatusBarProgressMeterPos@@YAHH@Z")> _
    Private Shared Function acedSetStatusBarProgressMeterPos(pos As Integer) As Integer
    End Function
    <DllImport("zwcad.exe", CharSet:=CharSet.Unicode, EntryPoint:="?zcedRestoreStatusBar@@YAXXZ")> _
    Private Shared Function acedRestoreStatusBar() As Integer
    End Function

    <CommandMethod("testPB")> _
    Public Shared Sub testPB()
        acedSetStatusBarProgressMeter("Testing Progress Bar", 0, 100)
        For i As Integer = 0 To 100
            For j As Integer = 0 To 10
                System.Threading.Thread.Sleep(1)
                acedSetStatusBarProgressMeterPos(i)
            Next
        Next
        acedRestoreStatusBar()
    End Sub
Post Last Edit by siggisal9294 at 2018-4-11 18:55

Hi

Thanks

I test the code no error but Progressbar don't show up

My settings
PROGBAR = 1
PROGBARTYPE = 1

VERNUM = "2018.03.16(29562)_x64" (read only)


  
    Public Shared Sub testPB()
        acedSetStatusBarProgressMeter("Testing Progress Bar", 0, 100)
        For i As Integer = 0 To 100
            For j As Integer = 0 To 10
                System.Threading.Thread.Sleep(1)
                acedSetStatusBarProgressMeterPos(i)
            Next
        Next
        acedRestoreStatusBar()
    End Sub


    Private Shared Function acedSetStatusBarProgressMeter(label As String, minPos As Integer, maxPos As Integer) As Integer
    End Function

    Private Shared Function acedSetStatusBarProgressMeterPos(pos As Integer) As Integer
    End Function

    Private Shared Function acedRestoreStatusBar() As Integer
    End Function
Post time 2018-4-12 16:23:11
Reply 3# siggisal9294


   Hi,   It seems there is a code segment missing before.
   Please check the attached file, there is the complete source code and the example.
TestSS_ZWCAD.dll (60.5 KB, Downloads: 64)
Thanks I can see the progressbar
New
You have to log in before you can reply Login | Register