BIGAL Posted June 28 Posted June 28 (edited) You can call powershell code using lisp. You make a BAT file with the call to the powershell. It in turn needs a ps1 file that actually has the script of powershell commands. An example have Excel open, but be in CAD from lisp run a bat and you are taken automatically to Excel as current active window. Do something in Excel like select cells then it returns to CAD with that info. Without this go to window you have to manually select the Excel window to continue. It is very powerful but is a helper for experienced coders. You can spend a lot of time converting an example to suit your needs. Edited June 28 by BIGAL Quote
jamami Posted July 2 Author Posted July 2 Thank you for the advice . seems this may offer me some help. Quote
jamami Posted July 10 Author Posted July 10 I have a few issues trying to use the core console. Firstly, there are varying suggestions for the set command in the batch file, I have seen a few examples that sate it should be use with the quotes after the equals set AutoCADCoreConsole="C:\Program Files\Autodesk\AutoCAD 2026\accoreconsole.exe" But other advice I have read that the quotes must include the whole path or the batch will assume the quotes are a part of the file name, ie:- set "AutoCADCoreConsole=C:\Program Files\Autodesk\AutoCAD 2026\accoreconsole.exe" also the example above shows %AutoCADCoreConsole% /i "%%f" /s "%lispFile%" -r M2A but the Autodesk website doesnt provide any details of an -r parameter, is -r correct? AcCoreConsole.exe [/i <input dwg>] /s <script> [/product <product>] [/l <language>] [/isolate <userid> <userDataFolder>] [/readonly] [/p[rofile] <profile>] [/loadmodule <module>] The Adesk example is : accoreconsole.exe /i "Floor Plan.dwg" /s "cleanup.scr" /product ACAD /l en-US when i try and run @echo off setlocal :: Set the path to the folder containing your DWG files set "folderpath=C:\Users\my name\share point\Technical\ASSETS\DWG\3D\LIGHT" :: Set the AutoCAD Core Console executable path set "AutoCADCoreConsole=C:\Program Files\Autodesk\AutoCAD 2026\accoreconsole.exe" :: Set the path to your LISP file set "lispFile=C:\AutocadScripts\Setdrawing.lsp" :: Loop through all DWG files in the folder for %%f in ("%folderPath%\*.dwg") do ( echo Processing: %%f "%AutoCADCoreConsole%" /i "%%f" /s "%lispFile%" /product ACAD /l en-UK ) endlocal I get an error that Setdrawing.lsp.scr cannot be found:- is it possible to run lsp files directly ? or do i have to create a script that then runs the lsp? Quote
SLW210 Posted July 10 Posted July 10 Is it in a Trusted Folder? Yes, it does appear you run a script in the accoreconsole to call the LISP save with .scr (load "C:\\path\\to\\your\\lispfile.lsp") (c:YourFunction) ; Replace with your LISP function and use this instead of the LISP line :: Set the path to your script file set scriptpath="C:\path\to\your\script.scr" Quote
jamami Posted July 10 Author Posted July 10 I’ll give it another go in the morning . i tried numerous ways to load the app but console always returns an error . the script path is in support files under options. i would have thought as we are explicitly specifying the script location this would not be an issue but (load……) always returns a file cannot be found error , the filling call to the lisp is the reported as on such function .. Quote
SLW210 Posted July 11 Posted July 11 Not Support File Search Path (that may need to be also), but Trusted Locations folder. Quote
jamami Posted Friday at 07:41 PM Author Posted Friday at 07:41 PM Great thank you . i am planning to add into the startup folder and give a go but got distracted today . 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.