dax Posted January 9, 2017 Share Posted January 9, 2017 Hello Guys, I have an lisp program that search text entity and extract data. however my program come up with an error "unknown command". Please help.. TIA, Dax extractEntity.lsp Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 10, 2017 Share Posted January 10, 2017 more than likey that the directory does not exist VLIDE gave up here (setq file (open "C:\\aut13\\extractedpsvdata.csv" "a")) (write-line (strcat filename "," tagNo "," press "," size) file) [color=red](close file)[/color] [color=red] [/color] Quote Link to comment Share on other sites More sharing options...
dax Posted January 10, 2017 Author Share Posted January 10, 2017 more than likey that the directory does not exist VLIDE gave up here (setq file (open "C:\\aut13\\extractedpsvdata.csv" "a")) (write-line (strcat filename "," tagNo "," press "," size) file) [color=red](close file)[/color] [color=red] [/color] Hi BIGAL, Thank you for your response. The directory exist, thought my lisp routine was working, but when I executed this to multiple drawings (using script file), it does not moved to the another drawings. I've also notice the "unknown command extractentity (which is in my program), but when I added (command "") or just pressing "enter command" on my program it just executed. I think this error causing the problem that why it did not moved to the another drawings. Quote Link to comment Share on other sites More sharing options...
dax Posted January 11, 2017 Author Share Posted January 11, 2017 Hi Guys, Anyone here who could help resolve the error.. Thanks, Dax Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted January 11, 2017 Share Posted January 11, 2017 Maybe you will get more answers if you post a test drawing. Exactly explaining what the program should do may also help (why the temporary circle?). Quote Link to comment Share on other sites More sharing options...
dax Posted January 11, 2017 Author Share Posted January 11, 2017 Maybe you will get more answers if you post a test drawing.Exactly explaining what the program should do may also help (why the temporary circle?). Hi Roy, Thanks for your response, there something wrong with my code when executing the lisp program thru .scr file, it gives me a unknown command "wp" which is reside on my lisp. But when this executed manually it just executed cleanly. (inside .scr file) .OPEN "drawing name" ZOOM A (C:EXTRACTPSVDATA) this working perfectly when entering manually.. Regards, Dax Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted January 11, 2017 Share Posted January 11, 2017 OK that is very useful information. The problem is caused by the CMDACTIVE variable. It is not zero when a script is running (see the documentation). Instead of: (if (zerop (getvar 'cmdactive)) ... ) Use: (if (zerop (logand (getvar 'cmdactive) 3)) ... ) Quote Link to comment Share on other sites More sharing options...
dax Posted January 12, 2017 Author Share Posted January 12, 2017 OK that is very useful information. The problem is caused by the CMDACTIVE variable. It is not zero when a script is running (see the documentation). Instead of: (if (zerop (getvar 'cmdactive)) ... ) Use: (if (zerop (logand (getvar 'cmdactive) 3)) ... ) Hi Roy, After changing the code, its works perfectly... Thanks much!! have your tried to load this kind of lisp to multiple drawings without using third party tools like script pro.. etc. Just wondering this is possible : - run batch program (open autocad and run .scr file) - .scr file will execute .lsp file to create another .scr file that contain list of drawings. Sample. .OPEN "drawing name1" (load "lisp program") lisp program .CLOSE Y .OPEN "drawing name2" (load "lisp program") lisp program .CLOSE Y Regards, Dax Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted January 12, 2017 Share Posted January 12, 2017 Just wondering this is possible : - run batch program (open autocad and run .scr file) - .scr file will execute .lsp file to create another .scr file that contain list of Probably. But I must say I do not understand the logic behind this approach. Quote Link to comment Share on other sites More sharing options...
dax Posted January 12, 2017 Author Share Posted January 12, 2017 Probably. But I must say I do not understand the logic behind this approach. This is a automation to extract data/attribute from a specific entity, initially I do this with batch program, but prob with this approach is that it open and close autocad instance per drawing, thats why I change it to iterate thru a .scr file. Im planning to have a UI on this on Excel format and the output will be also on Excel. The user for this been able to input text value and directory of the drawings. Regards, Dax 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.