LISP: To few arguments error

Discussion in 'AutoCAD' started by swu, Apr 23, 2004.

  1. swu

    swu Guest

    Probably a simple question from a lisp newbie:

    I am working with two routines I downloaded from

    4d-technologies.com

    The routines should label a 3Dpoly with an arrow drawn from High to Low indicating the direction water would flow.

    When I try and run the routine it gives me the following error:

    Command: pl_drawleaders
    *Cancel*
    too few arguments

    I have both routines loaded into autocad.

    ;; ! ****************************************************************************
    ;; ! PL_DrawLeaders
    ;; ! ****************************************************************************
    ;; ! Function : Draws Leaders along each segment of the polyline, thus showing
    ;; ! the direction of flow of the polyline.
    ;; ! Arguments:
    ;; ! 'vlist' - List of coordinates of the polyline
    ;; ! 'Closed' - Flag to indicate if the polyline is closed or not
    ;; ! Action : Returns a selection set of all the leader objects created
    ;; ! Updated : November 11, 2000
    ;; ! Copyright: (C) 2000, Four Dimension Technologies,

    (defun c:pL_DrawLeaders( vlist Closed / Seg SegLst ss OS )

    (setq OS (getvar "OSMODE"))

    (setvar "OSMODE" 0)

    (setq ss (ssget))

    (setq
    SegLst (GE_GetSegmentPoints vlist Closed)
    ss (ssadd)
    )
    (foreach Seg SegLst
    (command "._Leader" (nth 1 Seg) (nth 0 Seg) "" "" "_None")
    (ssadd (entlast) ss)

    )
    (setvar "OSMODE" OS)
    (if (> (sslength ss) 0) ss nil)
    )

    Routine # 2:

    ;; ! ****************************************************************************
    ;; ! GE_GetSegmentPoints
    ;; ! ****************************************************************************
    ;; ! Function : Returns a list of all segment start and end points from a list
    ;; ! of points
    ;; ! Arguments:
    ;; ! 'vlist' - List of points
    ;; ! 'Closed' - Flag to indicate if the polygon is closed
    ;; ! Action : Returns a list of segment points
    ;; ! Updated : February 8, 1999

    (defun c:GE_GetSegmentPoints( vlist Closed / SegPtLst cnt len pt1 pt2 )
    (setq SegPtLst '())
    (if vlist
    (progn
    (setq
    len (length vlist)
    cnt 0
    )
    (repeat (1- len)
    (setq
    pt1 (nth cnt vlist)
    pt2 (nth (1+ cnt) vlist)
    SegPtLst (cons (list pt1 pt2) SegPtLst)
    cnt (1+ cnt)
    )
    )
    (if Closed
    (setq SegPtLst (cons (list (last vlist) (car vlist)) SegPtLst))
    )
    (setq SegPtLst (reverse SegPtLst))
    ))
    SegPtLst
    )

    Thanks in advance,

    Scott
     
    swu, Apr 23, 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.