|
yes, still the same.
When I load the LISP, I get this message:
Command: (LOAD "E:/AutoCAD/LISP/ATTRIBUTE EXTRACT/DEXT.LSP") ; error: no
function definition: DOS_DEMANDLOAD
Okay, that's part of the DosLib function. Make sure DOSLib18.arx (or DOSLib18x64.arx if you're 64-bit) is in your support path. I load it in my accaddoc.lsp, so you may want to add them there as well. Try manually loading DOSLib18.arx and dext.lsp manually, then see if it works. If it does, then add them to your startup. HTH.
I do not use dataextraxtion command, so take from this what you will:
Code:(defun c:DEXT (/ *error* dxe dwg myDwg oldVars source vars) ;;--------------------------------------------------------------------; ;; User defined variables: ;;--------------------------------------------------------------------; (setq dxe "C:\\Temp\\dext.dxe") (setq dwg "C:\\Temp\\dext.dwg") (setq source "C:\\Temp\\dext-orig.dxe") ;;--------------------------------------------------------------------; ;; Main code ;;--------------------------------------------------------------------; (vl-load-com) (princ "\rDEXT ") (defun *error* (msg) (and oldVars (mapcar 'setvar vars oldVars)) (cond ((not msg)) ; Normal exit ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit) ((princ (strcat "\n** Error: " msg " ** ")))) ; Fatal error, display it (princ)) (prompt "\n\nPlease wait... ") (setq myDwg (strcat (getvar 'dwgprefix) (getvar 'dwgname)) vars '("CMDECHO" "FILEDIA") oldVars (mapcar 'getvar vars)) (mapcar 'setvar vars '(0 0)) (setq acDoc (vla-get-activedocument (vlax-get-acad-object))) (foreach file (list dxe dwg) (if (findfile file) (vl-file-delete file))) (if (findfile source) (vl-file-copy source dxe) (*error* (strcat (vl-filename-base source) (vl-filename-extension source) " not found"))) (vla-saveas acDoc dwg acNative) (command "._-dataextraction" dxe "yes" '(-75 75 0)) (vla-saveas acDoc myDwg acNative) (*error* nil) )
Last edited by RenderMan; 2012-06-27 at 04:10 PM. Reason: Changed '(dxe dwg) to (list dxe dwg)
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Your code has the elegance mine lacks. I haven't tried it yet, but it looks nice.
That is kind of you to say, stusic.
Given that the code is untested (on my end), I hope it works well.
I was merely hoping to offer others an alternative that precludes the dependency on DOSLib (something which I do incorporate into our setup), given others' stated difficulty, or at least unfamiliarity with using ARXLOAD.
Cheers!
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Get an error: ** Error: bad argument type: stringp DXE **
Sorry about that, stusic.
I mistakenly had a bad line of code; had to change '(dxe dwg) to (list dxe dwg)... the code I posted here has been updated. I do not have any DXE templates, so my code bombs when I supply an empty file to the command call. Let me know how this works out.
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000