Message 1 of 2
Can't Reenter Lisp. Invalid Point.

Not applicable
10-23-2019
01:45 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Having trouble with this LISP routine (full script below). Between these 2 lines...
(safeOpen importfile) (setq p1 (getpoint) )
...if I enter them independently and select the ACAD window between them, it works fine. If I enter them in a block (with the rest of the script), or if I enter them independently without activating the ACAD window between, I get the "Can't Reenter LISP. Invalid Point." error. What do I need to be doing between these 2 commands?
Full Script:
(setvar "SDI" 1) (setvar "LISPINIT" 0) (setvar "FILEDIA" 0) (setvar "TEXTEVAL" 1) (setq importpath "C:/Users/Jared/Desktop/TESTING/AutoLISP/output") (setq xrefs (vl-directory-files importpath "*.dwg" 1)) (setq x (nth 0 xrefs)) (defun safeOpen (importfile)
(command "qsave" "" "open" importfile ) ) (defun setScale (p1 p2 d1) (setq d2 (- (nth 0 p2) (nth 0 p1) ) ) ; reference length=p2[0]-p1[0] (command ; scale FROM 2 major column lines TO <input> "scale" All "" ; scale All p1 ; FROM base point "r" ; BY reference d2 ; reference length d1 ; scale TO ) ) (defun setBasePoint (p1) (command "move" All "" ; load selection set p1 ; get FROM point "0,0" ; TO origin (for easy xref insertion) ) ) ;(foreach x xrefs (setq importfile (strcat importpath "/" x) ) (safeOpen importfile) (setq p1 (getpoint) ) (setq p2 (getpoint) ) (setq d1 (getdist) ) (setScale p1 p2 d1) (setBasePoint p1) ;)