Paul Li Posted Sunday at 05:09 PM Posted Sunday at 05:09 PM Attached is an improved version of getfiled that implements powershell with the option to select single or multiple files returning a list of the selected item(s): Examples: (pl:getfiledps "Select Files" (getvar"dwgprefix") "dwg" 0) ; for single selection of file type dwg (pl:getfiledps "Select Files" (strcat (getenv "userprofile") "\\downloads") "dwg;dxf" 1) ; for multiple selection of file types dwg & dxf Feedback & comments are welcome. pl_getfiledps.lsp 3 Quote
SLW210 Posted 12 hours ago Posted 12 hours ago Many work computers are likely limited for using Powershell. Unrelated to Powershell being blocked, I get an error loading. error: string too long on input Quote
Steven P Posted 12 hours ago Posted 12 hours ago String too long - just a guess, file path and file name string length? - going back old school when we had 256? characters for it all - but just a guess Quote
SLW210 Posted 12 hours ago Posted 12 hours ago I'm not going to troubleshoot it since Powershell is blocked at work, but if the load has that error, then it's something in the Code, probable in the DCL write-line part. 1 Quote
Paul Li Posted 3 hours ago Author Posted 3 hours ago Thanks for troubleshooting. That could definitely be caused by having a write-line statement that's way too long. I've made the changes to reduce the write-line on the dcl. Kindly troubleshoot some more for offices that do allow for running powershell with the attached revised version...thanks in advance. pl_getfiledps.lsp Quote
GLAVCVS Posted 48 minutes ago Posted 48 minutes ago (edited) One observation: in older versions of AutoCAD (2000 and 2002, at least), 'vla-get-HWND' applies to the Document object rather than the Acad object. Edited 46 minutes ago by GLAVCVS Quote
BIGAL Posted 42 minutes ago Posted 42 minutes ago (edited) Works great often do old fashioned DOS to get file names list or use the VL files functions. A suggestion remove "result" from the local variables list. As the answer disappears. Or ; Example: ; (setq files (pl:getfiledps "Select Files" (getvar"dwgprefix") "dwg" 1)) A side comment I have used Powershell with Bricscad and sometimes does not work. Your code may help as you do a deeper dive into running Powershell. I generally only do a "Power shell and script" I have used it to change programs, I jump to Excel from CAD. Edited 40 minutes ago by BIGAL 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.