Jump to content

Need help to add "save as" command in my lisp


francine2013

Recommended Posts

I have written a small lisp allowing me to draw a tube, at the end of this lisp I would like to use the "save as" function with the variables seqt DIA and OFF preceded by the text CHS
The name of the drawing should be, for example:
CHS 21.3 1.5.dwg (see attached dwg)
21.3 being DIA
1.5 being OFF

 

can anyone help me please

CHS 21.3 1.5.dwg dt.lsp

Link to comment
Share on other sites

Try this, you will need a (vl-load-com) line somewhere before it to use VLA- commands, and you can set the version to save as by altering the last ac2010_dwg

 

(vla-SaveAs (vla-get-ActiveDocument (vlax-get-acad-object)) (strcat myfilepath myfilename ".dwg") ac2010_dwg)

 

 

(version codes: ac2018_dwg ac2013_dwg ac2010_dwg ac2007_dwg ac2004_dwg ac2004_dwg are generally that year +2 years so ac2018_dwg is 2018 to 2020 version)

  • Like 1
Link to comment
Share on other sites

How many tubes involved ? A dynamic block can have a look up and so just resize the 2 circles accordingly. Much easier than making a lisp to draw. 

 

The other alternative is make a list of dia and off for all sizes and just pick them from a drop down list.

 

If you post the sizes like this can help

 

21.3 1.5

24.0 2.0

26.5 2.2

27.8 3.0

 

If its less than 20 a simpler dcl can be used.

 

image.png

Edited by BIGAL
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...