GregGleason Posted March 16, 2018 Share Posted March 16, 2018 So after the end of quite a bit of program calls opening a drawing, near the end of the process I do a ... (command "zoom" "a")(princ) But it does not work. I'm thinking something happened along the way to make it not respond. Any ideas? Greg Quote Link to comment Share on other sites More sharing options...
Aftertouch Posted March 16, 2018 Share Posted March 16, 2018 Hello, Please post the full code, and keep in mind... When you open another DWG, the lisp wont continue in that DWG. A lisp file is DWG dependent. Quote Link to comment Share on other sites More sharing options...
ReMark Posted March 16, 2018 Share Posted March 16, 2018 "A lisp file is DWG dependent." Hmmmmmmmm..................................Wouldn't that depend on how the lisp routine or routines is/are being loaded in the first place? Acad.lsp vs. acaddoc.lsp? Quote Link to comment Share on other sites More sharing options...
GregGleason Posted March 16, 2018 Author Share Posted March 16, 2018 This is the portion from the acaddoc.lsp, with the zoom-all near the bottom: (princ "\n\n Start initializatons to dwg ...") ; Note status (command "undo" "9") ; Undo extra added stuff (command "zoom" "a")(princ) ;_zoom all (command "insunits" "1")(princ) ; drawing-units value set to "inch (command "units" "4" "16" "2" "3" "0" "N") ; change to architectural units (princ) ; (princ "\n Move BOM data to TEXT layer ...") ; Note status (setq mypath (getvar "dwgprefix")) ; Read and set current directory path (setq mylisp "SetWinToLayerTEXT.lsp") ; Set the lisp routine name (setq mypatlsp (strcat mypath mylisp)) ; Set the path/file of the lisp routine name (load mypatlsp) ; Load the lisp routine (c:SetWinToLayerTEXT) ; Run the lisp routine (princ "\n Move Layer 0 data to FIC layer ...") ; Note status (setq mylisp "ChgLay0toFIC.lsp") ; Set the lisp routine name (setq mypatlsp (strcat mypath mylisp)) ; Set the path/file of the lisp routine name (load mypatlsp) ; Load the lisp routine (c:ChgLay0toFIC) ; Run the lisp routine (princ "\n Find/move DIMLDR data to TEXT layer") ; Note status (setq mylisp "DIMLDRtoTEXT.lsp") ; Set the lisp routine name (setq mypatlsp (strcat mypath mylisp)) ; Set the path/file of the lisp routine name (load mypatlsp) ; Load the lisp routine (c:DTT) ; Run the lisp routine (princ "\n Explode all DIMLDR blocks ") ; Note status (setq mylisp "ExplodeDimldrBlocks.lsp") ; Set the lisp routine name (setq mypatlsp (strcat mypath mylisp)) ; Set the path/file of the lisp routine name (load mypatlsp) ; Load the lisp routine (c:EDB) ; Run the lisp routine (princ "\n Delete all ATTDEF with large text") ; Note status (setq mylisp "DeleteBigText.lsp") ; Set the lisp routine name (setq mypatlsp (strcat mypath mylisp)) ; Set the path/file of the lisp routine name (load mypatlsp) ; Load the lisp routine (c:DBT) ; Run the lisp routine (princ "\n Read Title Block Data and set ....") ; Note status (setq mylisp "UpdateTitleblockV1-9.lsp") ; Set the lisp routine name (setq mypatlsp (strcat mypath mylisp)) ; Set the path/file of the lisp routine name ;(load "P:\\CADWorx\\Project.Models\\Lyondell\\Piping.Iso\\UpdateTitleblockV1-9.lsp") (load mypatlsp) ; Load and autorun the lisp routine (princ "\nAutoLISP Title Block file loaded.") ; Note status (command "zoom" "a")(princ) ;_zoom all (princ "\n\n ========================================\n\n") (princ) Greg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 17, 2018 Share Posted March 17, 2018 Like aftertouch if this (load mypatlsp) or DBT is using OPEN then lisp will stop you need a script this can run across multiple dwgs and call lisps one simple way around dont know dwg name is to write the script file with correct dwg name as part of the 1st stage of using. then simple (command "SCRIPT" "ABCDEFG") this will end current lisp. Quote Link to comment Share on other sites More sharing options...
GregGleason Posted March 17, 2018 Author Share Posted March 17, 2018 Like aftertouch if this (load mypatlsp) or DBT is using OPEN then lisp will stop you need a script this can run across multiple dwgs and call lisps one simple way around dont know dwg name is to write the script file with correct dwg name as part of the 1st stage of using. then simple (command "SCRIPT" "ABCDEFG") this will end current lisp. This is all a single operation on one drawing that is already open. BTW, it echos out to the expanded history so you can see that it reached the code, it just does not process the code like it would normally. It does work if I place it earlier in the first part of the code, just not at the back end after all of the operations on the drawing. Greg Quote Link to comment Share on other sites More sharing options...
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.