AutoCAD Visual LISP / AutoLISP :: Remember The File Open Once Or The Path?
Jul 4, 2012
like in AutoCAD there is REMEMBERFOLDERS can u tell me if i use syntax with getfiled and i want the path to be remember next time what should i do or what syntax i use for that.
I am trying to make a script for inserting a standard title block in some drawings. ( which needs to be often done for different projects). The title block is kept in the network path. How can i specify the path in the script file in order to insert the block.
-Insert,> Block name > (I need to specify the drawing in the network to get the block in it)
I am trying to make a script file to open a drawing and run a lisp routine. They both work independently just fine, the script file will open the all of the files fine... and the lisp is in the startup suite and works in all the files. But when I tell the script file to open the first drawing then run the lisp it hangs trying to open the next file after running the lisp. I have Filedia set to 0, but the message I get when it goes to open the next is "No canvas exists. click New Canvas." (And on top of that... Filedia even set back to 1 still does not display the Dialog box anymore, I have to shut down AutoCAD 2012 and start again then it works.) I Have tried several ways, Opening one at a time then run lisp, and open all files first and then try to run lisp (that closes the file after running) and try and run it again in the next... It will only run the lisp one time and then locks up from there.
I'm trying to get the file name of a file outside the search path. Obviously (findfile) is not an option. The file location changes with each project so adding a search path is also not an option. I can get the path to the file but i can't seem to figure out how to get the file name. I can also get the first set of characters, as they are constant from project to project, it's just the end of the file name that changes. The file is always a PDF.
I'm try to write a list to produce a script file!I just want to insert a dwg file in current drawing.back to MS Windows, in case of having [space] in a folder's name, we should use "" marks:
CD "Program Files"; DEL "file 10.txt"; ....
I tried both with and without "" marks but I failed!I pasted part of my code below with result of each case:
I'm using a Lisp which searches a certain folder and then updates all blocks, which are nested in that folder.
My issue is, that I'd like to use more than one folder on different path, where the LISP can search for this files. Is there a way to use multiple search path?
The code I'm using now to search for the blocks is: (setq dir "I:\AutoCAD Blöcke\Template\Support")
Could a .lsp file work with the block editor so that double-clicking a block will make it skip straight to the editor without displaying the "Edit Block Reference" dialoge?
I have set up a master set of dwg. files we use to create our construction documents. The files consist of a master file that xrefs base files. All of our files are named using the project # first. (i.e. 2011001c.dwg). I have set up the master set using x's to replace the numbers.
Here is how it works:
XXXXXXXc.dwg (master file) relative path xref's the following files. XXXXXXXlw.dwg XXXXXXXvlw.dwg XXXXXXXeg XXXXXXXfg XXXXXXXtitleblock
note: all of these files are saved in the same folder.
I am trying to find a way to keep the xref paths working when I copy the files to a project folder and rename the files using the actual job # insead of the x's as place holders. As it is now, when I change the drawing name the reference is lost and I have to manually change all of the xref paths in the xref manager. Is there a command, program, or lisp routine than can change the file names and update the paths automatically.
There are times that I have a really long curb polyline that has both line and arc segments. I wish to pick two points along that polyline and have it give me the distance between those two points along the path of the polyline.
Do we have this ability natively? Have I been missing something all this time? Normally I have to make a copy of the original entity, ... break, break, list erase or undo....
Our I.T department uses kixstart to run a batch script every morning, which is supposed to establish a network connection. The connection is 9/10 times available. 1/10 times it fails and means that workspaces and other user defined settings are inaccessible.
Bringing up the issue with I.T seams to eparch on there skills as a professional so nowadays I tend to bring it up once maybe twice but then settle for ding it my self
So what I found out is the following batch scrip/ snippet is used to establish a network
net use P: \AutoCAD_2012-08-22
I could compile a batch and then launch it using a lisp for example
(command “startapp”….
Or
(command “shell".However this would be hakky and also requires two files (the lisp and then also the bat file, rather keep it simple just the one).Is it possible to establish this connection using lisp?
I do a lot of repetitive tasks in my daily drawings and I’d like to make life easier! I was researching how I could write a lisp to draw a walkway path for a roof. I came across a couple of interesting posts but couldn’t follow the code because of my lack of understanding the language.
So what I do is draw a 30” x 30” square (using the rectangle command). Then copy it so there is a 2” gap between them. Then I go back and hatch them with a dot hatch scaled to 96. What I’d like to do is type a command and it would draw the walkways for me and hatch them if possible. The problem is the last one is a custom cut size depending on the length of the walkway run?
Now I know I can draw a line, draw the square, hatch the square, array it on the path with set distance between items, then fix the last one so it looks the way I want it to, and then delete the line. But why do all that when I have a program that allows me to customize it to be done for me?
I used this snip it to add the path for network tool palettes. It works but it keeps adding the same search path every time i open a new session of AutoCAD. The list keeps getting longer with the same information. Say you want to make sure your users all have a certain tool palette.
I have this code w/ which I can open up Block Library Blocks for editing. We have R2012 installed w/out VBA.Our MIS department is impossible to deal with. We have this new fangled permission hysteria so I cannot install VBA myself.Is there any other way to open up my blocks? What I can I do instead?
(defun CpL () (prompt "...Open Library Block or Xref...")(terpri) (setq a (entsel)) (setq b (car a )) (setq c (entget b)) (setq d (assoc 2 c)) (setq e (cdr d)) (setq ff (strcat e ".dwg")) (setq PP (findfile FF)) (setq opath (strcat "acadapplication.documents.open ""PP""")) (command "vbastmt" opath))
Is it possible to open a dwg, change something and then plot a layout with visual lisp. This is my start. Opening is working, but plotting not. I have to switch between drawings before the function is going on. Sometimes it's plotting an empty sheet and otherwise an error: ERROR: Automation Error. Description was not provided.
I'm trying create a LISP to customize PDF creation. The lisp looks into the .PC3 file which paper size better fits the plot area. But its exaustive to every time i want to create a new paper size i have to open the .pc3 file and configure a new paper.
There is a way to open the .pc3 properties through lisp?
Is there a way Autocad could just do what I asked for, and nothing more?A few examples
- After publishing, the publish dialog auto closes. I don't wat that. After publishing dwf I also want pdf.(I know you can save the list, that's not the point. If you didn't close the dialog I wouldn't need it)
- When selecting a hatch, the ribbon automatically jumps to Hatch Editor. I don't want that. Maybe I just want to change the layer. I can find the Hatch editor my self..Dito for XREFS
- I do not want any dialog giving me warnings, about anything.
If an XREF doesn't get attached, I can see that. I don't need a dialog telling me.If a shape file is missing, I can see that..A triangle sign above the command line is totaly adequate.Don't auto open or close dialogs, for what ever reason.
So ... don't auto do anything I can perfectly do manualy. No doubt there are a few more examples I can't think of right now.The nice thing would be to get a variable that gives me that "no auto" mode.
I have a small number of drawings that I use very often. I would like to make a menu item to open a certain drawing but I keep getting stuck when the drawing name should be entered automatically.I use the code
^C^Cfiledia;0;open;"test.dwg";filedia;1;
The drawing is my support file search path and the name is unique. How do I get this to work properly?When running this command:
Command: filedia Enter new value for FILEDIA <1>: 0 Command: open
Enter name of drawing to open <C:previous.dwg>:
*cancel* Command: "test.dwg" Unknown command ""TEST.DWG"". Press F1 for help. Command: filedia Enter new value for FILEDIA <0>: 1
It asks what file to open and suggests the last opened file, and whatever I tried so far this keeps happening.
*.scr files are not allowed on our network, I can't create or rename files to *.scr. Of course I could ask the admins to allow this but I think our security policy is more important than me having a button to open a file.
We have stored lisp in fileserver which 30 users can access it. Now a day some users have getting the ‘failed to open project’ error after load the Lisp due to this they r also not getting most of the commands. The full rights have been given to appropriate folder which contains (Autolisp application source file, .vlx, Autocad VBA source). It has working for limited users (8-10 users).
How to create lisp which i can simply type in to the command bar so that the current drawing's filepath-folder will be automatically opened by windows explorer?