AutoCAD Visual LISP / AutoLISP :: Create Command That Will Copy File From One Place To Another?

Jan 7, 2014

I would like to create a command that will copy a file from one place to another.

I can do it directly from the commandline like this

But when I try and put it in a command macro in the CUI editor like this

^C^C_shell;copy "c:/temp/drawing1.dwg" "g:/temp";

it does not seem to work. It comes up with this on the commandline

but no copy of the file is made.

How can I get this to work without having to write an external file, such as a script or lisp?

View 1 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: C Copy Command Has No Mode Option

Dec 19, 2013

I'm trying to set my default for the 'c' copy command to be multiple in AutoCAD 2014. I set 'c' under aliasedit to COPY, but when I use the command 'c' it brings up [Displacement Multiple] as options but no mOde. If I use the command 'co' it brings up [Displacement mOde]. How do I set my 'c' copy command to default to multiple?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copy Command Doesn't Work?

Oct 18, 2013

In AutoCAD 2011 in mapclassic mode I removed some buttons that I don't use from the Modify toolbar and now the copy command doesn't work.  I can't even type in the command line. 

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copy Text String From One File To Another

May 2, 2012

I have spent the last three days writing a lisp program that will copy a text string from one text file and paste it into another.  I have tried using the write-string, getstring, prin1, princ and print functions with no success. 

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Print Last Line Of Command History To A File

Mar 26, 2012

I've been killing myself with trying to get the following (acet-getvar '("BNS_EDITTIME_TOTAL")) in standard time format

rather than julian and then printing it to a file.  I never found a way.  So I'm figuring the next best thing is to just run the edittime command and then set a custom variable to report the last line of the command history.  Then I can open a file and print it to the file.  But alas my skills are lacking. 

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Loop File Names In Command Prompt?

Dec 6, 2012

I have a parent directory with x-amount of folders contained inside. I say X-amount because I would like to keep adding or deleting folders as time progresses. I want the folders contained within this parent directory do be read into a lisp variable and then be printed to the command prompt till every folder is displayed by name, then the loop may stop.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Executing Command If Find File Returns NIL

Dec 17, 2012

Im having a little trouble of late understanding how to undertake an action/ command if nil

what i do know id the following:
 
(setq TESTvar(findfile "acad.lsp"))(alert TESTvar)

this gives me the path of the acad.lsp, that is provided it actually exists, however because the acad.lsp is not compulsory  it may indeed not exist meaning that the command prompt would return the NIL value instead of the pathname.

based upon that I would like to create a new acad.lsp file if not found by autocad.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Save Additional Copy Of DWG File Using Macro

Aug 11, 2012

I need to save an additional copy of a AutoCAD drawing whenever I press the save button.

Simply put, Every time I press save the autocad drawing is saved (Obviously!!!) but

I also need to save an exact copy of the drawing in a folder called (for eample only) "C:TestFolder"

I can do this using DxfOut for dxf files but I need to do this for dwg files.

Can it be done whenever I press the "save" button.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export TIME Command Results To Text File

Oct 22, 2011

Run TIME command and then take the resulting text and save it to a file.

Ideally, the text file should be named based on the drawing name. I know there's ways to write text to a file but I haven't had any luck taking the output of a command and exporting it.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: List Command Dumping To Text File Locally

Oct 31, 2013

Need a lisp that could dump the values of a list command in a text file placed in a folder C:user121list.txt.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copy Shortcut C Doesn't Copy Multiple But Typing In COPY Does

Aug 23, 2013

I have a keyboard shortcut for Copy (see directly below). This command doesn't copy multiple. But if I type "Copy" at the comment prompt (AutoCAD 2013) the copy multiple is the default. Copymode is already set to "0".

(DEFUN C:C()
(setvar "SNAPMODE" 1)(COMMAND "_COPY")
(PRIN1)
)

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create TXT File

Apr 3, 2012

Looking for example of a lisp file that take the value of a variable and create a txt file on a specific place defining by the user, with 10 lines in each one of them begins with what is in the variable, followed by a text already done.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create VLX File

Aug 6, 2013

how can i create single " .vlx" file from my lisp and dcl files?  how to convert my lisp to vlx ?

i have to collect my all lisp into the single .lsp file and than convert to .vlx? if it is gonna be like that how about dcl file ?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create New ARG File

Jul 18, 2012

How to create a new .ARG file

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File That Create Layout For Each Layer?

Apr 13, 2013

Lisp file that create a layout for each layer,I’m looking for a lisp file that creates layout for each layer instead of doing this manually.

Software: AutoCAD 2014, AutoCAD C3D, AutoCAD M3D, Revit
Windows 7 (Ultimate 64 bits),
Firefox 20.0,
Kaspersky 2013.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Annotation Command Set Correct Layer For Duration Of Command

Nov 21, 2010

I am currently writing a series of routines for setting the layers for text, leaders and dimension commands. The end goal is a system where any annotation command sets the correct layer for the duration of the command, then reverts back to the layer that was active before the command.

I have managed to complete all the code, and it appears to be working fine, I just have one question: I have used -layer "m" "Lay_name" etc... for all layer setting commands, rather than any code to see if the layer exists already. In my limited testing this seems to be suitable, nothing that exists on that layer seems to be affected.

I know how to write code to determine if the layer exists already and set the layer instead, but so far it seems unnecessary??

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Write A Lisp Routine That Invoke The Mleader Command

Oct 11, 2012

I'm trying to write a lisp routine that, when I invoke the mleader command, osmode is set to "nearest" & orthomode is set off. I then would like the original settings to be returned.

attached is what I have written so far:-

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Place A Line Behind Other Items

Nov 13, 2012

I have a lisp file that reads in a point list from a text file and creates a number with a circle around it for every point, then a line from one circle to the next in line with the center point of each circle. Is there a simple way of making the lines "go behind the circles". The portion of code that creates the circles, lines and text is as follows and a cutout screen dump of what it looks like is below.

(setq amount 0)
(foreach item lines
;;;                                                              ;;
;;;  Create the text                                             ;;
;;;                                                              ;;
 (setq x (+ (atof (nth 2 item)) (car pt_origin)))
 (setq y (+ (atof (nth 3 item)) (cadr pt_origin)))

[Code]....

IV 2010

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Why They Change Object Layer In Place

Nov 11, 2013

This is in regards to the LIP command in Toolpac. The layer properties for a selected nested object (LIP) used to default to nested. Now you have to select nested from the list of options. Why they would change LIP. My whole company had gotten so used to it.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Place Object On Demo Layer

Jul 20, 2011

I want to create a routine that will place selected objects on a the corresponding demo layer.  Here is the outline:

enter command
select object
extract layer name of object (i.e. "CS CURB")
if demo layer exists  (i.e. "CS CURB CD")
>put object on demo layer
>else create demo layer, and place object on layer

I could select multiple objects on different layers.is this possible with lisp? any good starting point for lisp programing?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Place Aligned Dimensions On Each Segment Of Polyline?

Feb 6, 2006

Have Lisp to place aligned dimensions on each segment of a polyline?

I would use it for reinforcing bar detailing.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Place Lights In Room Evenly?

Jan 13, 2013

Lisp routine that divided up a normal square / rectangle room and insert a block at each given point.

At present if the room was to have four lights width ways and three lights length ways we would divide the width by eight to give us 1/2 1 1 1/2 so the lights would be placed on every second point after the divde command (dividing the room by twice the amound of lights needed). 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Nil At The End Of Command

Jun 22, 2012

I have a routine that work fine, but I receive a nil at the end of command. How to fix that?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: DOS DIR Command

Oct 27, 2012

I need a program that simulate this DOS command: dir /on/b *.dwg >list.txt

it list all dwg files on current open dwg file folder and sort them and finally put them in a text file with list.txt name. something like thistype list.txt)

test1.dwg
test2.dwg
test100.dwg
test256.dwg
test1005.dwg

(sort alphabetically and logically) because of disabled DOS utility in my PC I need a pure lisp functions, I tried to wrote this program but I couldn't!!

(defun c:listMaker()
(vl-load-com)
(setq path (getvar "dwgprefix"))
(setq fn "list.txt")
[code]...

and also I need a append a string(='This Is EOF') in the last line of the "list.txt" file.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Can't Get While Command Right?

Apr 13, 2012

I am trying to get my original layer and lintype reinstated after the user is finished with the pline..I know Im suppose to use the while command but am now completely lost on which way to do this

(DEFUN c:TEST1 ()(if (not (tblsearch "LTYPE" "MYWC")) (command "-linetype" "LOAD" "MYWC" "C:/COUNTER.LIN" ""));SECOND PROGRAM...;CREATE CORESPONDING LAYER...(command "._Layer" "Make" "WC LEIDING" "Ltype" "Continuous" "" "Color" "211" "" "")(SETQ MYOLDCELTYPE (GETVAR "CELTYPE"))(SETVAR "CELTYPE" "MYWC")(while (PROGN(COMMAND "pline")(SETVAR "CELTYPE" MYOLDCELTYPE)))

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Closed Polyline And Place Mtext With The Room Name And Area In M2

Oct 24, 2013

LSP file i downlaoded from web.it is to use for Area with (m2) and room name. by click polyline.

i want to modify it to use without adding Room Name, just insert area to the drawing.

(defun drtxt (/ rn tx ls vl lt ht lb hb nr pt)
  (setq tx (strcat "Area: "
       (rtos (/ (getvar "area") 1000000) 2 2)
       " m2"
       )         
       rn (getstring "
Room Name: ")

[code]....

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Place Circle On Selected Blocks Insert Point?

Mar 11, 2013

You have a dwg with multiple sets of different blocks and a circle you want to place on the insert point of each set blocks. 

You select the circle then select one of the blocks in the set and the circle is placed on the insert point of each of the blocks in that set. It would save time from doing it manually and save on mistakes.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Error In While Command

May 22, 2013

We have a lisp routine that I co-authored ages ago and then haven't done much programming in about 7 years.  I seem to have forgotten much of my language skills.  This portion of the lisp routine was running fine in autocad 2005 which is what the computer had on it, and it doesn't run on autocad 2010. 

I've narrowed it down to the while statement which is why you see it commented out, but that portion is necessary.   My main question is was there a change in the language specifically the while statement between 2005 and 2010? 
 
; GET LINES OVER 10" AND THROW OUT (if (= (cdr(assoc 0 outerinfo)) "LWPOLYLINE") (progn (setq remlenouter 0.0) (setq numseg (cdr(assoc 90 outerinfo))) (setq edd (member(assoc 10 outerinfo) outerinfo)) (setq n1 0) ;(while (< n1 (- (* numseg 4) 4)) ;(setq dist (distance (cdr(nth n1 edd)) (cdr(nth (+ n1 4) edd)))) ;(if (>= dist edmmax) (setq remlenouter (+ remlenouter dist))) ;(setq n1 (+ n1 4)) ;) ; end while (setq dist (distance (cdr(nth n1 edd)) (cdr(nth 0 edd)))) (if (>= dist edmmax) (setq remlenouter (+ remlenouter dist))) ) ; end progn ) ; END IF

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Looping A Command

Aug 26, 2013

I am using AutoCAD 2011. I have a lisp that I have created/modified.

What it does:

Allows me to Select a layer that I call out and change its color properties back to bylayer.

(i primarily use this when i am cleaning up my drawings, I turn them all to gray with another command i have then i run this one to find all the entities on that specified layer)

What i am trying to do: 

I would like this command to do a loop.  So say i type in a layer name that does not exist, instead of running through the rest of the command i want it to revert back to "specify layer name" until the correct name is entered for that layer.

Here is the lisp:

(defun cLL ()
(setq varLayer (getstring t "
Specify Layer Name: "))
(sssetfirst nil (ssget "X" (list (cons 8 varLayer))))
(command "change" "p" "" "p" "c" "bylayer" "")
(princ)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check For Last Command

Jan 8, 2014

We have developed processes, standard operating procedures, work instructions (whatever you want to call it) for several tasks we do on a regular basis.  More importantly, tasks that we don't do on a regular basis.  On some processes, performing certain commands is a critical step in the quality of the product.  I have also developed a lot of lisps to streamline these processes.  Of course there are commands that just don't make sense to try and include into existing lisps.

The problem we're having though, is that people are not following the processes.  I don't know if they think they are smarter than the process, or if they don't understand the process, or if they are just complacent.

One of the things that would really work to get everyone to follow the process, is to have my lisp routines check to see what the last entry at the command line was.

For example, if one of my lisps depended on the drawing be saved, well, instead of putting the save command in the lisp, sometimes it would be beneficial to check to see if the drawing was saved in the first place.  Kudos to those who do follow the process, they do save the drawing, and then run the lisp.  On rather large files, I would prefer not to save the drawing twice, back to back.

There are a lot more benefits to checking to see what the last user entry was, in a certain drawing. 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: DCL Command Locking Up

Aug 8, 2012

 I am new to DCL programming and am having an issue getting a button to recognize a command.  As a simple first attempt, I am trying to create a dcl with a button called "draw test line"  that will draw a line from 0,0 to 1,1.  The lisp loads correctly and the "cancel" button works fine.  However when the "draw test line" button is pressed, autocad locks up and the only solution is to restart.  here is the dcl

testline : dialog {
          label = "draw line test";
          : column {
            : boxed_column {
              : button {
                key = "but1";
                label = "draw a line";
                is_default = false;
[code]....

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved