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.
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.
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.
how I could open an external .CSV file which is assigned to a variable called INFOFILE and scan line by line and replace each instance of the string "WIDGETTE" with the string "WIDGET"? I assume the function vl-string-subst woud be involved.
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.
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??
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.
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)
(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!!
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
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?
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.
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.
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
how to check snap errors in drawing in a specified layer against some other layer. means first layer should end with second layer otherwise place error.both layers have linear features.
My drawing constitutes of many blocks and other objects , and i need to find specific blocks (with same block name) in my drawing which i cannot find them one by one and i though that i can find them all with lisp routine ..
so , i wanna specify point out of my drawing area and lisp routine will draw to line from basepoint of those blocks to specify point when i select one reference block.
We use multi-leader objects in our drawings. When the multi-leader and its value are to be replicated throughout the drawing, we create mleaders with fields that show the contents of the first mleader. That way we can update only the value in the first mleader and all of its children will update as well. It works nicely for us.
Here comes one snag. If one of us opens a drawing with which we are not intimately familiar, we don't know which mleader is the parent of which children. There might be fifty parents and four hundred children in a drawing so going through them by hand is a big productivity drain.
What I need to do is write a routine that will let the user select the mleader that includes the field and have the routine highlight and/or zoom to the parent object.
I thought I should be able to find that info in the dxf codes for the mleader, but I am either missing it or it's not there.
Is it possible to control the UCS without using the command line? I'd like to access it and control it with vlisp much the same way I can access DXF groups and manipulate insertions. Seems like it should be possible to play with it's definition inside the object model.
I am working on a lisp to scale drawings of various sizes to a predetermined size. After the lisp has run and scaled the drawing, the prompts for base point and reference point run a second time. How can I get this to run through once? I think it has something to do with the way the reference length is being entered. The base point and first reference point are the lower left corner of the drawing, while the second reference point is the lower right corner.
(COMMAND "SCALE" "ALL" "" (SETQ A (GETPOINT " SELECT BASE POINT :")) "R" A (GETPOINT " SELECT REFERENCE POINT : ")) "1'-5"")
Most efficient way to transfer my custom pgp commands? I'm constantly moving between different computers and autodesk versions.
I used to just be able to overwrite the acad.pgp file in the support directory but this doesn't seem to work in the newer versions and I'm hesitant to continue like that in case their are new commands introduced in newer versions that I don't know about then they'd be over written.
Is there anyway to include my command overrides (eg. c=copy) in my back up cui file?
It is possible to cancel a command using visual lisp reactors. If this is not there another way I could do that. I tried to use UNDEFINE but it works only with own CAD commands and not with Visual Lisp command.
I have a custom command that I can initiate (c:TxtE). The function starts running but I need to begin adding several inputs at the command line following this. (ex: "4" "all" "" "oldtext" "newtext"). How do i do that within lisp once the custom command has already begun? If I need to modify the function how would i pass all these as optional type variables?
I am attempting to create a export command for our surveyors that deletes all there point layers and seal layer, then audits and saves the file before opening the etransmit command.
Below is what I currently have.I know there is a better way to do this, but it is above my programing skill right now. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SURVey export(defun C:SRVY () (command "-laydel" ; Delete Survey data "Name" "F0" "Name" "F1" "Name" "F2" "Name" "F3" "Name" "F4" "Name" "F5" "Name" "F6" "Name" "F7" "Name" "F8" "Name" "F9" "Name" "F10" "Name" "F11" "Name" "F99" "Name" "SHEET-SEAL" ENTER "YES" ) (command ".audit" "y") ; Audits file (command "_qsave") ; Save changes (command "-etransmit" "Choose Setup" "ACAD2010" "Create transmittal package" ) (princ))
AutoCAD Civil 3D 2012 (Primary), 2011 by contract.
Dell Percision T3500: MS Windows 7 64-bit SP1; Intel Xeon CPU W3505 @ 2.53GHz, 12.00 GB RAM, NVIDIA Quadro 600