Results 1 to 5 of 5

Thread: New to VBA

  1. #1
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Default New to VBA

    Hi All,
    I'm new in this VBA forum and know 0.00% of VBA.
    I know that AutoLisp is a drawing level language.
    I am now going to learn some basic of VBA.
    To start, could anyone please give me some help on which can be functional when a drawing is open.
    Here is a sample:
    Code:
    If a specified drawing (in folder "C:\Test", for example) is open, set "LTscale" to 0.5.
    Thanks in advance.

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: New to VBA

    If you're looking to learn a higher level development language, then I would strongly suggest that you instead look into the .NET (C#,F#,VB,etc.) API in lieu of VBA, as it is no longer supported, and the newer application versions are increasingly exposing API features to the .NET API.

    The only other alternative I can think of would be the ObjectARX (C++ for AutoCAD) API.

    Good luck!
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Default Re: New to VBA

    Thanks RenderMan.
    I will post the same question to ".NET" forum though.

  4. #4
    All AUGI, all the time arshiel88's Avatar
    Join Date
    2005-02
    Location
    Off the Grid
    Posts
    560
    Login to Give a bone
    0

    Default Re: New to VBA

    Quote Originally Posted by BoKirra View Post
    ...
    Code:
    If a specified drawing (in folder "C:\Test", for example) is open, set "LTscale" to 0.5.
    Sorry, cant resist. But just for fun, that would translate to:
    Code:
    Dim aDoc As AcadDocument
    For Each aDoc In Documents
        If aDoc.FullName = "C:\Test\SomeDrawing.dwg" Then
            ThisDrawing.SetVariable "LTSCALE", 0.5
            MsgBox "The value of LTSCALE is now " & ThisDrawing.GetVariable("LTSCALE") & "."
        End If
    Next
    But, I would strongly encourage you to go for .NET while you're at the least knowledge on VBA. Because when you can solve 95% of the problems in VBA, you would find it hard/impractical to learn/bother using a stand alone developing software (e.g. Visual Studio Express) as opposed to using the integrated VBA IDE in AutoCAD. Like me, who was encouraged many times to learn .NET, never found the time or the necessity to do it. So, go for it while you can.

  5. #5
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: New to VBA

    Quote Originally Posted by BoKirra View Post
    Thanks RenderMan.
    I will post the same question to ".NET" forum though.
    Sorry for the delayed response, work has very much unexpectedly become hectic... Had I see this prior, I could have just moved this thread for you.

    I'm happy to help, BoKirra - I think you'll find .NET development to be a great challenge, yet incredibly useful, and it's (the .NET API's) ability to expand LISP by way of LispFunction Methods can also be incredibly powerful (as we will be working to do in this thread).
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •