class module

Discussion in 'AutoCAD' started by youngman, Jun 12, 2004.

  1. youngman

    youngman Guest

    hi ,

    could you please tell me something about class module.

    i know nothing about it,

    what good dose a class module do to us .

    thanks

    cheers
     
    youngman, Jun 12, 2004
    #1
  2. That's a huge topic. You may want to visit a beginner's programming site for
    detaile tutorial on the subject. Use Google to search for VB and VBA sites.
     
    Frank Oquendo, Jun 12, 2004
    #2
  3. youngman

    Ed Jobe Guest

    Frank's right that there is a lot to learn, but you could probably state the main purpose of a class faily simply. It allows you to create your own object with its unique properies and methods. For example, I have a set of text utilities where I've created my own text object. I have added to the properties of a standard text object and given it new functions to fit my needs.

    --
    ----
    Ed
    ----
    That's a huge topic. You may want to visit a beginner's programming site for
    detaile tutorial on the subject. Use Google to search for VB and VBA sites.
     
    Ed Jobe, Jun 14, 2004
    #3
  4. youngman

    youngman Guest

    thank you.

    what you told me is just what i want to know.

    thanks

    Frank's right that there is a lot to learn, but you could probably state
    the main purpose of a class faily simply. It allows you to create your own
    object with its unique properies and methods. For example, I have a set of
    text utilities where I've created my own text object. I have added to the
    properties of a standard text object and given it new functions to fit my
    needs.

    --
    ----
    Ed
    ----
    That's a huge topic. You may want to visit a beginner's programming site
    for
    detaile tutorial on the subject. Use Google to search for VB and VBA
    sites.
     
    youngman, Jun 15, 2004
    #4
  5. youngman

    Dave Guest

    We use class modules in a few ways.

    One way is that we create a macro dvb file. In it we add a module such as:

    Public Sub show_settings()
    Dim xSmartFull As New cSmartFull
    xSmartFull.ShowSettings
    Set xSmartFull = Nothing
    End Sub

    We ake a lisp file to define that command:

    ;smd
    (defun c:sset() (command "-vbarun" "C:/Program
    Files/SmartLister/Support/SmartListerMenu.dvb!mStart.show_settings"))
    (princ)
    ;/smd

    Now we can type sset and this macro is called.

    We have a vb dll that has a class module in it called cSmartFull

    The class module is referenced in the dvb module, if you read it above,
    along with the specific function.

    They are:
    cSmartFull <---the class module im the vb dll
    and
    xSmartFull.ShowSettings <---the function to call within it

    In the actual class module we have this code:

    Public Sub ShowSettings()
    BeginSmartSettings
    End Sub


    BeginSmartSettings is the call to a regular module in the our mMain code.

    Public Sub BeginSmartSettings()
    frmSettings.Show vbModal
    End Sub


    This launches the the frmSettings for the user to see.
    ------------------------------------------------------

    We also have one where it monitors the command line for certain commands. If
    they are executed it will then automatically fire a different piece of code
    (module) that calls a class module in the dll then calls the code to be run.

    I am not a programmer, so there are certainly different ways to use it that
    I am unaware of. The basic understanding I have is that one of the practical
    uses is so that you can build a vb dll to protect your code, also runs
    faster, but you need a class module in it so that you have a way of
    accessing it. We used an ACAD dvb file, but I would bet there are most
    certainly other ways to call it. I would think it could be called directly
    from lisp or c++ easily and probably any other programming language.

    --
    David Wishengrad
    President & CTO
    MillLister, Inc.
    Software for BOM, measuring, stretching and controlling visibility of
    multiple 3D solids.
    Http://Construction3D.com
     
    Dave, Jun 16, 2004
    #5
  6. youngman

    wivory Guest

    If it's not considered a trade secret, can you please explain how it "monitors the command line for certain commands"?

    Thanks

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Jun 17, 2004
    #6
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.