vla-AppendVertex Question

Discussion in 'AutoCAD' started by Vxc, Feb 7, 2005.

  1. Vxc

    Vxc Guest

    Hy All !

    I work with Auto-lisp for some while but I'm still new at Visual Lisp.
    I'm trying to convert the Z coordinate to 0 on a 3D Polyline.
    I believe that the command is "vla-AppendVertex".

    This is my code...

    (Setq Line (car(entsel)))
    "Pick line"
    (Setq VL-Line (vlax-ename->vla-object Line)) "Convert to VL
    Mode"
    (Setq VL-Info (vlax-dump-Object VL-Line)) "List properties of
    the Line"
    (Setq VL-XY (vla-get-Coordinates VL-Line)) "Get the Variant
    with the coordinates"
    (Setq VL-Value (vlax-variant-value VL-XY)) "Put it on a
    Safearray"
    (Setq VL-XYMod (vla-AppendVertex VL-Array)) "Errr... something goes
    wrong here..."

    I think that the error is on the last line, I'm missing something there.
    If someone else have a better way (I bet there is) to work this out I
    would thank that help !

    Vxc
     
    Vxc, Feb 7, 2005
    #1
  2. Vxc

    BillZ Guest

    From the help files:

    object.AppendVertex Point

    Object

    3DPolyline , Polyline, PolygonMesh
    The object or objects this method applies to.


    Bill
     
    BillZ, Feb 7, 2005
    #2
  3. Vxc

    Jeff Mishler Guest

    "AppendVertex" means to add a vertex to the end, which is not what you are
    after. To change all of the Z values to 0, once you have the coordinate
    list, change every third element to 0.0, then vla-put back the new
    coordinate list to the pline.

    To make it easier, if you use (vlax-get vl-line 'coordinates) it will return
    as a list instead of a variant/safearray.....some thing with (vlax-put
    vl-line 'coordinates coordlist)
     
    Jeff Mishler, Feb 7, 2005
    #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.