Problem with AecWall in AutoCAD VBA???

Discussion in 'AutoCAD' started by Jim Cheng, Feb 11, 2004.

  1. Jim Cheng

    Jim Cheng Guest

    I am using AutoCAD Architectural Desktop 3.3, and I want to customize
    it using VBA. When I try to run the example subroutine from the help
    files, I encounter the following error:

    Dim wall As AecWall
    "Compile error: user-defined type not defined."

    Do I need to take extra steps to include the AecWall type into the
    autocad VBA environment?
    How could I solve this problem?

    Thanks!

    Jim


    Sub Example_EndPoint()

    'This example displays the end point for the wall

    Dim obj As Object
    Dim pt As Variant
    Dim wall As AecWall

    ThisDrawing.Utility.GetEntity obj, pt, "Select a Wall"

    If TypeOf obj Is AecWall Then
    Set wall = obj
    Dim pointStr As String
    pointStr = Format(wall.EndPoint(0), "0.00") & ", " _
    & Format(wall.EndPoint(1), "0.00") & ", " _
    & Format(wall.EndPoint(2), "0.00")
    MsgBox "Wall End Point: " & pointStr, vbInformation, "End
    Point Example"
    Else
    MsgBox "Not a Wall", vbExclamation, "End Point Example"
    End If

    End Sub
     
    Jim Cheng, Feb 11, 2004
    #1
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.