Mark_ATCW Posted March 27, 2018 Share Posted March 27, 2018 Hi All, I'm new to this forum so i hope i have posted this in the correct place, please let me know if i haven't! Ok to get started i have a script that i run before i print a drawing but it does not always work the way i wont it to. In the script it runs a lisp file. i have attached the lisp, script and block file that i use. Can someone out of the goodness of their heart create a single lisp file for me? i have attempted to do this but i get very lost in the lisp programming side. thanks heaps, Mark Timestamp.lsp ATCW_Timestamp_awa.scr A3_Stamp.dwg Quote Link to comment Share on other sites More sharing options...
DGRL Posted March 27, 2018 Share Posted March 27, 2018 @Mark_ATCW Can you just write down what you want to do because it seems and I guess that this can be 1 lsp in total without the script part Quote Link to comment Share on other sites More sharing options...
Mark_ATCW Posted March 27, 2018 Author Share Posted March 27, 2018 Sorry all, I uploaded the wrong script file, correct one attached. Mark Timestamp.scr Quote Link to comment Share on other sites More sharing options...
Mark_ATCW Posted March 27, 2018 Author Share Posted March 27, 2018 Hi, yep ok. We have some old drawing that contain a "date stamp block" which is named "A3_Stamp" which contains old formatting stuff and info inside the block. So what i have tried to do is: 1. Select the block "A3_Stamp" delete it from the drawing and purge it from the drawing. 2. then run the lisp program which bring the time stamp block back into the drawing and then fills out the attributes in the block automatically. 3. Save the drawing 4. then bring up the plot dialog box. The issue I'm having is that if the stamp block "A3_Stamp" is not in the drawing or it has a different name then it randomly deletes a block in the drawing, very random. I want it to pretty much do the same thing but in a single lisp file but add a command to be able to insert this block onto a particular layer. Does this make sence? Thanks Mark Quote Link to comment Share on other sites More sharing options...
DGRL Posted March 27, 2018 Share Posted March 27, 2018 Atm I don't have that much time but I would suggest to remove the whole script and make it autolisp The ssget in the script can be in lisp something like (ssget "_x" '((0 . "INSERT")(2 . "A3_Stamp"))); From here do the rest All the commands in the script can be made in autolisp also Quote Link to comment Share on other sites More sharing options...
DGRL Posted March 27, 2018 Share Posted March 27, 2018 @Mark_ATCW Do you know how to work with selection sets? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 27, 2018 Share Posted March 27, 2018 (edited) Add the DGRL ssget before the Insert, wrap it in a IF ie if a selection set then delete the block use -purge B "A3_Stamp" you can save a dwg, you can set up a lisp plot. We have set title block so we have predefined plot routines for pdf and various plotters. (if (setq ss (ssget "_x" '((0 . "INSERT")(2 . "A3_Stamp")))) (progn (command "erase" ss "")(command "-purge" "B" "A3_Stamp")) ) (command "Insert" "A3_Stamp.dwg" "0,0" "" "" "" thedate thetime plotby savename) ;insert the block and fill in the attribute data Edited March 28, 2018 by BIGAL Quote Link to comment Share on other sites More sharing options...
Mark_ATCW Posted April 17, 2018 Author Share Posted April 17, 2018 Perfect guys, Thanks to your help i now have a perfectly working lisp :thumbsup: Cheers Mark P.S. I can upload should someone like to use it 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.