Translate coordinates troubles.

Discussion in 'AutoCAD' started by BillZ, Jun 28, 2004.

  1. BillZ

    BillZ Guest

    R2005 Vlisp:

    From the help files:

    To translate a point on a Polyline or LightWeightPolyline object from OCS to WCS:

    1. Get the X and Y coordinates of the OCS point from the Coordinate or Coordinates property.

    2. Get the Z coordinate of the OCS point from the Elevation property.

    3. Get the Normal for the polyline from the Normal property.

    4. Call TranslateCoordinates using the X, Y, Z coordinates and the Normal.

    Okay, the list of coordinates has the z value because its a 3dpoly I'm gettting this from. But when I try to use:

    Command: (vla-TranslateCoordinates (list 21.8651 1.36718 0.0) norm_1)
    ; error: bad argument type: VLA-OBJECT (21.8651 1.36718 0.0)

    I've tried making the pointa vlax-3d-point with no luck.

    norm_1 is the normal object.

    Command: !norm_1
    #<variant 8197 ...>

    TIA

    Bill
     
    BillZ, Jun 28, 2004
    #1
  2. BillZ

    Jeff Mishler Guest

    Bill,
    First, when using the ActiveX methods you must supply a response to all
    arguments.
    Second, the "TranslateCoordinates" method is applicable to what object? This
    is the root of the error you are getting.
    This is why I include these in my startup files:
    (setq *acad* (vlax-get-acad-object)
    *doc* (vla-get-activedocument *acad*)
    *util* (vla-get-utility *doc*))

    This is the form you must use:
    (vla-translatecoordinates *util* (vlax-3d-point (list 21.8651 1.36718 0.0))
    acOCS acWorld :vlax-false norm_1)

    HTH,
    Jeff

    gettting this from. But when I try to use:
     
    Jeff Mishler, Jun 28, 2004
    #2
  3. BillZ

    BillZ Guest

    Jeff,

    It was the Utility that threw me.

    Thanks.

    Bill
     
    BillZ, Jun 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.