Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to load this lisp file and I receive "Command: ; error: extra right paren on input".
I put one or 2 parenthesis at the finish of the file, but I receive the same error.
Any help please.
;Show flow direction ;Stefan M. - 26.07.2015 (defun c:flow ( / *error* ms ss e l key d n c y p f a p1 p2 p3 ar) (or acDoc (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))) (setq ms (vlax-get acDoc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))) (vla-startundomark acDoc) (defun *error* (msg) (and msg (not (wcmatch (strcase msg) "*CANCEL*,*QUIT*,*EXIT*")) (princ (strcat "\nError: " msg)) ) (vla-endundomark acDoc) (princ) ) (if (eq (vla-get-lock (vla-get-activelayer acdoc)) :vlax-true) (progn (princ "\nCurrent Layer is locked.") (exit) ) ) (if (setq ss (ssget ":E:S" '((0 . "POLYLINE") (-4 . "&=") (70 . ))) (progn (or (tblsearch "layer" "arrow") (vla-add (vla-get-layers acDoc) "arrow")) (setq e (ssname ss 0) l (vlax-curve-getdistatpoint e (vlax-curve-getendpoint e)) ) (initget "Distance Items" 1) (setq key (getkword (strcat "\nPolyline length = " (rtos l) "\nChoose a method [Distance/Items]: "))) (if (eq key "Distance") (setq d (getdist "\nDistance between arrows: ")) (setq n (getint "\nNumber of arrows: ")) ) (if n (setq d (/ l n))) (if d (progn (setq c 0.0 y (/ d 5.0)) (while (< (setq c (+ c d)) l) (setq p (vlax-curve-getpointatdist e c) f (vlax-curve-getfirstderiv e (vlax-curve-getparamatpoint e p)) a (angle '(0.0 0.0) f) p1 (polar p a (if (minusp (caddr f)) (- y) y)) p2 (polar p1 (+ a (* pi 0.5)) (* 0.4 y)) p3 (polar p1 (- a (* pi 0.5)) (* 0.4 y)) ar (vla-Add3DPoly ms (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . ) (append p2 p p3) ) ) ) (vla-put-closed ar :vlax-true) ;;; (vla-put-color ar (if (minusp (caddr f)) acred acyellow)) (vla-put-layer ar "arrow") ) ) ) ) ) (*error* nil) (princ) )
The code is from here: https://www.cadtutor.net/forum/topic/57478-arrow-on-3d-polyline-to-show-water-flow-direction/
Solved! Go to Solution.