Consulting

Results 1 to 5 of 5

Thread: Need help with defining object methods (my own, not autocads) in autocad vba

  1. #1
    VBAX Newbie
    Joined
    Oct 2008
    Posts
    4
    Location

    Question Need help with defining object methods (my own, not autocads) in autocad vba

    if i define the following method for a class object Matrix, that I created

    Public Sub AddPlane(row As Integer, p As Plane)

    I get a syntax error when I try to use the following code:

    someMatrix.addPlane(0,somePlane)

    If hypothetically i change my method so it only has one argument

    Public Sub AddPlane(row As Integer)

    then calling it

    someMatrix.addPlane(0)

    will work.

    Can anybody explain why creating a method with 2 arguments isn't callable?

    Thanks

  2. #2
    VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,168
    Location
    Hi Gobc

    Welcome to VBAexpress!

    To try to answer your question, I would think that a Plane is not defined. I would suggest that you change it to AcadPlaneSurface. I am unsure as to what you are trying to do though.

    HTH

  3. #3
    VBAX Newbie
    Joined
    Oct 2008
    Posts
    4
    Location
    Hi Tommy,

    Thanks for the reply. Plane is an object that I created. Prior to making my post, I did some trial and error to ensure that having a custom object as my function argument wasn't causing the problem.

    Gobc

  4. #4
    VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,168
    Location
    I would need to see more of your code to help now. I don't see anything else other than if someplane is not defined as a Plane.

  5. #5
    VBAX Newbie
    Joined
    Oct 2008
    Posts
    4
    Location
    thanks for you help Tommy. I got around the problem by defining the sub as a function and returning a dummy value. It just seams VBA won't let me define a sub that accepts two arguments. I have to make it a function and return a value.

    Gobc

Posting Permissions

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