VL ucs help needed

Discussion in 'AutoCAD' started by BillZ, Dec 23, 2004.

  1. BillZ

    BillZ Guest

    R2005:

    I'm trying to figure out when to use ActiveX functions or the regular autolisp.
    I start my program with:
    (vla-InitializeUserInput Util 1)
    (setq CenObj (vla-GetPoint Util nil "Center Point: ")
    )
    which returns a vla object.

    then later in the program I need to create a new UCS with vla-add and the origin and x and y axis need a variant array of doubles.
    I want to use CenObj as the origin and get the x&y axis from there (basically a 90d x axis from the origin).
    Do I have to get the variant value of the coordiante of CenObj and the do a polar for the x axis point then figure the y axis point too?
    And why do some vl functions return an object and some an iteger or real like the following?
    (vla-InitializeUserInput Util 7)
    (setq RadDis (vla-GetDistance Util CenObj "Radius Distance: ")
    )

    Just seems like so much more code than plain autolisp was to accomplish the same objective.

    I'm just learning VL so bear with me here.

    TIA

    Bill
     
    BillZ, Dec 23, 2004
    #1
  2. Bill,

    There is no compelling reason to use the Utility object's methods in Visual
    LISP. The Utility object was provided to VBA programmers to provide them
    with similar methods to AutoLISP functions. In fact, the object's methods
    have some quirks compared to the AutoLISP functions.

    However, I do prefer to use the ActiveX objects when creating/modifying the
    drawing where possible.

    Also, the UCS object has some quirks of its own, just thought I'd warn you.
    <vbg>

    --
    R. Robert Bell


    R2005:

    I'm trying to figure out when to use ActiveX functions or the regular
    autolisp.
    I start my program with:
    (vla-InitializeUserInput Util 1)
    (setq CenObj (vla-GetPoint Util nil "Center Point: ")
    )
    which returns a vla object.

    then later in the program I need to create a new UCS with vla-add and the
    origin and x and y axis need a variant array of doubles.
    I want to use CenObj as the origin and get the x&y axis from there
    (basically a 90d x axis from the origin).
    Do I have to get the variant value of the coordiante of CenObj and the do a
    polar for the x axis point then figure the y axis point too?
    And why do some vl functions return an object and some an iteger or real
    like the following?
    (vla-InitializeUserInput Util 7)
    (setq RadDis (vla-GetDistance Util CenObj "Radius Distance: ")
    )

    Just seems like so much more code than plain autolisp was to accomplish the
    same objective.

    I'm just learning VL so bear with me here.

    TIA

    Bill
     
    R. Robert Bell, Dec 23, 2004
    #2
  3. BillZ

    BillZ Guest

    Thanks Robert,

    I had my suspicions about this.
    Thanks for the clarification. :)


    Bill
     
    BillZ, Dec 28, 2004
    #3
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.