Jump to content

Turn a lisp and a script into 1 lisp file


Mark_ATCW

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by BIGAL
Link to comment
Share on other sites

  • 3 weeks later...

Perfect guys,

 

Thanks to your help i now have a perfectly working lisp :thumbsup::thumbsup:

 

Cheers

Mark

 

P.S. I can upload should someone like to use it :)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...