Just want to be sure... When I copied the routine code and pasted it in, this is what it looked like.
Does it matter if the code would look like this to paste?
; This routine runs the code in the active editor of NotePad++ from AutoCAD:
(defun C:n++ nil (C:RunFromNotePadPP)) ; Quick Run
(defun C:RunFromNotePadPP ( / scr *error* err np++ npeditor npSS npMS r )
; NOTE: Requires ActiveX plugin(by David Gausmann) installed on the NP++
; https://sourceforge.net/projects/nppactivexplugin/
(defun *error* (m)
(foreach x (reverse (list np++ npeditor npSS npMS))
(vl-catch-all-apply (function vlax-release-object) (list x))
)
(gc) (gc)
(and msg (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\nError: " msg)))) (princ)
); defun *error*
(setq err
(vl-catch-all-apply
(function
(lambda nil ; THIS WORKS - IT GETS THE ACTIVE DOCUMENT CODE IN NOTEPAD !!!
(setq np++ (vlax-get-or-create-object "NotepadPlusPlus.Application"))
(setq npeditor (vlax-get np++ 'ActiveEditor))
(vlax-invoke-method npeditor 'selectAll)
(setq npSS (vlax-get npeditor 'selections))
(setq npMS (vlax-get npSS 'mainSelection))
(setq r (vlax-get-property npMS 'text))
(vlax-invoke npSS 'setRange 0 0 0 0)
); lambda
); function
); vl-catch-all-apply
); setq err
(*error* nil)(princ)
(if (and r (not (vl-catch-all-error-p err)))
(eval (read (strcat "(list\n" r "\n)")))
)
); defun
Base point: (defun C:RunFromNotePadPP ( / scr *error* err np++ npeditor npSS npMS r )
(_> ; NOTE: Requires ActiveX plugin(by David Gausmann) installed on the NP++
(_> ; https://sourceforge.net/projects/nppactivexplugin/
(_>
(_> (defun *error* (m)
((_> (foreach x (reverse (list np++ npeditor npSS npMS))
(((_> (vl-catch-all-apply (function vlax-release-object) (list x))
(((_> )
((_> (gc) (gc)
((_> (and msg (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\nError: " msg)))) (princ)
((_> ); defun *error*
(_>
(_>
(_> (setq err
((_> (vl-catch-all-apply
(((_> (function
((((_> (lambda nil ; THIS WORKS - IT GETS THE ACTIVE DOCUMENT CODE IN NOTEPAD !!!
(((((_> (setq np++ (vlax-get-or-create-object "NotepadPlusPlus.Application"))
(((((_> (setq npeditor (vlax-get np++ 'ActiveEditor))
(((((_> (vlax-invoke-method npeditor 'selectAll)
(((((_> (setq npSS (vlax-get npeditor 'selections))
(((((_> (setq npMS (vlax-get npSS 'mainSelection))
(((((_> (setq r (vlax-get-property npMS 'text))
(((((_> (vlax-invoke npSS 'setRange 0 0 0 0)
(((((_> ); lambda
((((_> ); function
(((_> ); vl-catch-all-apply
((_> ); setq err
(_>
(_> (*error* nil)(princ)
(_> (if (and r (not (vl-catch-all-error-p err)))
((_> (eval (read (strcat "(list\n" r "\n)")))
((_> )
(_> ); defun
C:RUNFROMNOTEPADPP
Base point: