(setq plist (vl-directory-files (getvar "dwgprefix") "*.dwg" 1))
(foreach ins1 plist
(setvar "lispinit" 0)
(command "open" ins1)
(command "insert" "C:\Users\asmoley\Desktop\B\SK100_BD\" "0.875,0.28125")
(command "save" ins1)
);foreach
(setq plist nil)
bad variable name in SETQ and malformed string on input errors. I am a very inexperienced programmer. Help?
Since AutoLISP runs in the document namespace, its scope is limited to the active drawing, and any program running in the active drawing will cease evaluation when that drawing is no longer active.
To operate on multiple drawings you would need to either use an AutoCAD Script or ObjectDBX; for a beginner, I would advise the former suggestion, and would refer you to this post.
I hope this points you in the right direction.
Lee