VBA Drawing Preview

Discussion in 'AutoCAD' started by KingCAD, Mar 2, 2004.

  1. KingCAD

    KingCAD Guest

    HI guys,
    Is there a quick and easy way to create a drawing preview similar to the one in the open drawing dialog box? And before you ask NO I cannot use the common dialog control and access the open dialog box, well I can but that's not what my engineering manager wants. (too many "clicks")
    So what I would like to do is to create an Image control that will show the preview of the drawing that has been selected.

    Thanks

    Dave. K
     
    KingCAD, Mar 2, 2004
    #1
  2. KingCAD

    KingCAD Guest

    OH YEAH,
    I should probably mention that I am using VB6 and not VBA. With AutoCAD 2002.

    Thanks.

    Dave. K
     
    KingCAD, Mar 2, 2004
    #2
  3. Depends upon your version of AutoCAD. You can use either the Thumbnail or
    VoloView Express controls. If pre-2004, you can also use the Preview
    control - I'm not sure if it has been updated for 2004.
     
    Mike Tuersley, Mar 2, 2004
    #3
  4. KingCAD

    Colin French Guest

    Try the "DrawingThumbnail.ocx". You can embed one or more previews in a VB6 form using this OCX. I believe the control is available in the Customer Files newsgroup. Version 1.9 was the last one I got, but there may be newer ones by now.

    ...Colin French
     
    Colin French, Mar 2, 2004
    #4
  5. KingCAD

    KingCAD Guest

    Okay I Found the DwgThumbnail,ocx and it works "okay" but Now I would have to got to each computer and install, and register it. Plus if I make the preview larger the picture "SUCKS" any way around these two things??

    Thanks

    Dave. K
     
    KingCAD, Mar 2, 2004
    #5
  6. KingCAD

    Kevin Terry Guest

    the volo view control will be better for you if you are making it larger

    Kevin

    to got to each computer and install, and register it. Plus if I make the
    preview larger the picture "SUCKS" any way around these two things??
     
    Kevin Terry, Mar 2, 2004
    #6
  7. KingCAD

    KingCAD Guest

    Okay, where do I , How do I, What do I. I do not currently have voloview installed, so I will need to do that first?? and then what??

    Thanks.

    Dave. K
     
    KingCAD, Mar 2, 2004
    #7
  8. Voloview Express should be on your AutoCAD cd. Just install it and go back
    into your project and reference the control. To load the file, make sure
    you set the SRC property. From there, use a freeware install program such
    as InnoSetup to deploy your solution.
     
    Mike Tuersley, Mar 2, 2004
    #8
  9. KingCAD

    KingCAD Guest

    SRC!? How the heck do you get drawing name out of that?/ Oh well it works. ONE more question how would I set it up to zoom all when it opens the drawing, it currently defaults to some zoomed out view.

    Thanks for all the help.

    Dave. K
     
    KingCAD, Mar 3, 2004
    #9
  10. Well Dave, it depends entirely on the build. As each build was released,
    commands changed. Here are two methods that I used:

    AvViewX1.SetFocus
    SendKeys "+{F10}Z+A"

    Public Sub ViewChange()
    'Programmed ZoomExtents feature
    AvViewX1.SetFocus
    Dim dLeft As Double
    Dim dRight As Double
    Dim dBottom As Double
    Dim dTop As Double
    AvViewX1.GetDrawingExtents dLeft, dRight, dBottom, dTop
    AvViewX1.NamedView = "View=(" + Str(dLeft) + "," + _
    Str(dBottom) + ")" + "(" + Str(dRight) + "," + Str(dTop) + ")"
    AvViewX1.Update
    End Sub

    In the help file, there should be some info on api stuff as well as using
    the object browser once you have the reference in place.
     
    Mike Tuersley, Mar 3, 2004
    #10
  11. KingCAD

    KingCAD Guest

    Thanks Mike I'll figure it out from here. Thanks a whole heapin' Helpin' for the help!

    Dave. K
     
    KingCAD, Mar 3, 2004
    #11
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.