Author Topic: What is this? = AecRcpLispSupport::getArgIgnore() got null."  (Read 2213 times)

0 Members and 1 Guest are viewing this topic.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
What is this? = AecRcpLispSupport::getArgIgnore() got null."
« on: March 25, 2010, 01:34:18 PM »
After running a lisp routine I am getting this at the command line
Quote
AecRcpLispSupport::getArgIgnore() got null."

Whatever it is; it locks up Vlide editor with now way to break it.  But Autocad thought it was done and I could move on to other commands.

Quote
(defun MakeDirList (Arg / TmpList)
 (setq TmpList (cddr (vl-directory-files Arg nil -1)))
 (cond
  (TmpList
   (setq DirList (append DirList (mapcar '(lambda (z) (strcat Arg "/" z)) TmpList)))
   (foreach Item TmpList (MakeDirList (strcat Arg "/" Item)))
  )
 );end cond
);end MakeDirList
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

johnm

  • Guest
Re: What is this? = AecRcpLispSupport::getArgIgnore() got null."
« Reply #1 on: March 26, 2010, 01:08:32 PM »
the issue is in the foreach line that makes a call back to the main defun MakeDirList
this is just bad code and could cause an infinate loop

Lee Mac

  • Seagull
  • Posts: 12899
  • London, England
Re: What is this? = AecRcpLispSupport::getArgIgnore() got null."
« Reply #2 on: March 26, 2010, 01:16:02 PM »
the issue is in the foreach line that makes a call back to the main defun MakeDirList
this is just bad code and could cause an infinate loop

Surely the recusive call will terminate when the end of the folder tree is reached  :?

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: What is this? = AecRcpLispSupport::getArgIgnore() got null."
« Reply #3 on: March 26, 2010, 01:22:59 PM »
IT does terminate but something is not releasing.  it affects the saving and closing of the drawing that I am in Once closed it at least frees up the vlide editor. 

I starting to play by trial and error (my MO on lisping).  I rename the arg variable but it did not change change the message the command prompts gives me.  AecRcpLispSupport::getArgIgnore() got null

This lisp is a Cadalyst Tip lisp and has been around a while.  I know it does not say much.

Code: [Select]
;;;CADALYST 03/05 Tip2023: PurgeFiles.lsp Directory Clean Up (c) Andrzej Gumula


;;; [c]2004 Andrzej Gumula, Katowice, Poland
;;; e-mail: a.gumula@wp.pl
;;; This routine purge dwg files from selected folder


(vl-load-com)

(defun c:PurgeFiles (/ FilesList DwgPath SubDir Files File)

(defun GetFolder (/ Dir Item Path)
 (cond
  ((setq Dir (vlax-invoke (vlax-get-or-create-object "Shell.Application") 'browseforfolder 0 "Select folder with DWG files:" 1 ""))
   (cond
    ((not (vl-catch-all-error-p (vl-catch-all-apply 'vlax-invoke-method (list Dir 'Items))))
     (setq Item (vlax-invoke-method (vlax-invoke-method Dir 'Items) 'Item))
     (setq Path (vla-get-path Item))
     (if (not (member (substr Path (strlen Path) 1) (list "/" "\\")))
      (setq Path (strcat Path "\\"))
     );end if
    )
   );end cond
  )
 );end cond
 Path
);end GetFolder


(defun vl-findfile (Location / DirList Path AllPath)
 (MakeDirList Location)
 (setq DirList (cons Location DirList))
 (foreach Elem DirList
  (if (setq Path (vl-directory-files Elem "*.dwg"))
   (foreach Item Path (setq AllPath (cons (strcat Elem "/" Item)  AllPath)))
  );end if
 )
 (reverse AllPath)
);end vl-findfile

(defun MakeDirList (/ SAMPLETEST TmpList)
 (setq TmpList (cddr (vl-directory-files SAMPLETEST nil -1)))
 (cond
  (TmpList
   (setq DirList (append DirList (mapcar '(lambda (z) (strcat SAMPLETEST "/" z)) TmpList)))
   (foreach Item TmpList (MakeDirList (strcat SAMPLETEST "/" Item)))
  )
 );end cond
);end MakeDirList

(if (not FileSystemObject)
  (setq FileSystemObject (vla-getInterfaceObject (vlax-get-acad-object) "Scripting.FileSystemObject"))
);end if

(cond
((= (getvar "SDI") 0)
(cond
 ((setq DwgPath (GetFolder))
  (initget "Yes No")
  (setq Subdir (cond ((getkword "\nLooking for subfolders? No,[Yes]: "))
     (T "Yes")))
  (if (equal SubDir "Yes")
   (setq Files (vl-findfile (substr DwgPath 1 (1- (strlen DwgPath)))))
   (setq Files (mapcar '(lambda (x) (strcat dwgpath x))(vl-directory-files DwgPath "*.dwg" 1)))
  );end if
  (setq Files (mapcar 'strcase Files))
  (cond
    (Files
     (vlax-for & (vla-get-documents (vlax-get-acad-object )) (setq FilesList (cons (strcase (vla-get-fullname &)) FilesList)))
     (foreach & Files
      (cond
((not (member & FilesList ))
         (cond
  ((/= (logand (vlax-get-property (vlax-invoke-method FileSystemObject 'getfile &) 'Attributes) 1) 1)
   (cond
     ((setq File (vla-open (vla-get-documents (vlax-get-acad-object)) &))
      (prompt (strcat "\nPurge " & ". Please wait..."))
              (repeat 3 (vla-purgeall File)) ; ADDED REPEAT TJK-2010-03-25
      (prompt (strcat "\nSave and close " &))
      (vla-save File)
      (vla-close File)
      (vlax-release-object File)
     )
     (T (prompt (strcat "\nCannot open " & "\nDrawing file was created by an incompatible version. ")))
   );end cond
  )
  (T (prompt (strcat & " is read-only. Purge canceled. ")))
);end cond
)
(T (prompt (strcat & " is open now. Purge canceled. ")))
      );end cond

     );end foreach
    )
    (T (prompt "\nNothing files found to purge. "))
  );end cond
 )
 (T (prompt "\nNothing selected. "))
);end cond
)
(T (prompt "\nThe routine is not available in SDI mode. "))
);end cond
(princ)
);end c:PurgeFile

(prompt "\nLoaded new command PurgeFiles. ")
(prompt "\n[c]2004 Andrzej Gumula. ")
(princ)
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans