API Variant_BOOL

Discussion in 'SolidWorks' started by Vigilante, Oct 12, 2003.

  1. Vigilante

    Vigilante Guest

    is Variant the same as Variant_BOOL for VisualBasic?
    i mean that there is an entry in help:

    <code>
    (VARIANT_BOOL) bEnable
    retval = SldWorks.EnableStereoDisplay ( bEnable )
    Thus, any plug-in that might need to display stereoscopically should, upon
    loading, immediately call EnableStereoDisplay, with the flags field set to
    0x01. To actually activate stereo display, call EnableStereoDisplay with the
    flags field set to 0x03. To deactivate stereo display, call
    EnableStereoDisplay with the flags field set to 0x01. Finally, just before
    the plug-in uninstalls, restore SolidWorks' default behavior by calling
    EnableStereoDisplay with the flags field set to 0x00.
    </code>
    but i can not find any way to assign 0x03 to Variant, and
    Dim bEnable as Variant_bool
    does not compile
    i`ve tried
    Dim bEnable as Variant
    bEnable=3
    and
    bEnable=-3 (because true is -1)
    but i don`t know if it worked
    How can i set bitfields in VB? i have been programming in delphi, i am not
    good in Microsoft .Net
     
    Vigilante, Oct 12, 2003
    #1
  2. Vigilante

    Heikki Leivo Guest

    (VARIANT_BOOL) bEnable

    Boolean value is simply a number, where False equals zero and True equals
    any non-zero value. In VB, True is defined as -1, since in binary it is
    11111111. This is to ensure, that "Not True" equals "False". In some
    applications written in C, "True" may be any non-zero value.
    Do you have a plug-in, which is able to display stereoscopically? I have
    tried to tweak with stereo display as well, but the API functions in SW
    doesn't seem to affect the SW display. I believe, that you should have an
    add-in which would have an own OpenGL code to render the screen in stereo.

    It would be interesting, indeed, if SW could render the left & right eye
    images as stereo pair in the SW screen. No physical device such as goggles
    would then be needed to display in true 3D.
    Just like that.

    -h-
     
    Heikki Leivo, Oct 12, 2003
    #2
  3. Vigilante

    kellnerp Guest

    I think if you assign 0x003 to DIM bEnable as variant then bEnable will
    return a hex value. If you assign a double it will be a double, etc.

    My other thought is that 0x01 and 0x03 are not booleans, they are hex and
    typically stored in integers.
     
    kellnerp, Oct 12, 2003
    #3
  4. Vigilante

    Heikki Leivo Guest

    I think if you assign 0x003 to DIM bEnable as variant then bEnable will
    Hex is not a data type, it is just a way how to express numbers. There is no
    difference beetween bEnable = 0x03 and bEnable = 3.
    Boolean is simply an integer which is called boolean. Zero means "false" and
    non-zero means "true". "True" is just an integer constant which has value
    of -1. You can assign any numerical value to boolean variable, but it is
    quite rare.

    -h-
     
    Heikki Leivo, Oct 12, 2003
    #4
  5. Vigilante

    Vigilante Guest

    How can i set bitfields in VB?
    No, i don`t have such plug-in.
    there was such plug-in on www.stereoworks.com but it is no longer there.
    I have Quadro4 780GLX and shutter glasses, but i can`t get it to work in SW
    .. . .
    ..(works fine with other apps)

    Thanks for help
     
    Vigilante, Oct 12, 2003
    #5
  6. Vigilante

    kellnerp Guest

    Didn't say hex was a data type. Read carefully what I said.

    Dim bEnable as Variant

    sub main()

    bEnable = &HA
    debug.print bEnable

    end sub

    If you put a watch on bEnable you will find that &HA is stored as an integer
    and debug.print will print 10.
     
    kellnerp, Oct 12, 2003
    #6
  7. Vigilante

    Vigilante Guest

    Yes, please.
    My addres does not contain any "-" (minuses)
    Thanks in advance.
     
    Vigilante, Oct 12, 2003
    #7
  8. Vigilante

    Vigilante Guest

    Well, there`s the result:
    Plug-in installed, added an option to Turn it on.
    When turned on, i can see a difference, because image goes a bit right. It
    looks like it shows only the image for right eye, not switching to left.
    Shutterglasses appear not to turn on, nor even blink.
    When i adjust stereo options, image goes a bit left or right.
    So there is something about it, but so far i didn`t manage to make it work .
    .. . .
     
    Vigilante, Oct 13, 2003
    #8
  9. Vigilante

    Vigilante Guest

    I write it one more time, including keywords, so i hope someone searching
    google will find it

    Keywords: SolidWorks stereo stereographics GeForce Quadro4 SoftQuadro
    shutter glasses API EnableStereoDisplay

    My story is that i bought gaiward Ti4200 + Stereo Shutter glasses for 3D
    viewing, and intended to work with it in SolidWorks.
    Bad luck, though. did not worked.
    I`ve conducted deep search and finded another post that with Asus GF it
    doesn`t work either.
    Here`s what i`ve tried:
    1. SoftQuadro4 with RivaTuner -> GF becomes Q4 780 GLX
    2. StereoGraphics Plug-in for SolidWorks 2001
    3. almost evry combination of settings

    Well, there`s the result:
    Plug-in installed, i can see it added an option in SW\View to Turn it on.
    When turned on, i can see a difference, because image goes a bit right. It
    looks like it shows only the image for right eye, not switching to left.
    Shutterglasses appear not to turn on, nor even blink.
    When i adjust stereo options, image goes a bit left or right.
    So there is something about it, but so far i didn`t manage to make it work .

    If you find out anything that might help, please let me know:
    (with no antispam - minuses inside)
     
    Vigilante, Oct 13, 2003
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.