Search the Community
Showing results for tags 'open'.
Found 15 results
open file and close it immediately
Manuel_Kunde posted a topic in AutoLISP, Visual LISP & DCLHi, I need a small lisp that opens and closes a file for me in the background. Nothing needs to be done. In this lisp the file is opened but not closed. (defun c:open_close_explorer () (setq Path "Y:\\Folder\\Data\\Test.txt") (setq File (StartAPP "Explorer.Exe" Path)) (close File) (princ) ) Does anyone have an idea?
Problem using variable within Script (.scr)
ABrook1982 posted a topic in AutoLISP, Visual LISP & DCLHi, this is my first post on the forum & I'm also pretty new to AutoCAD scripts & Lisp routines, so please bear with me. Basically I have the following script: (setq dn (strcat (getvar "dwgprefix") "New Drawing.dwg")) (vl-propagate 'dn) _.saveas 2010 !dn This script saves my current drawing as 'New Drawing.dwg' within my current directory, and works fine. When I try to modify the script to the following, which attempts to open instead instead of save, it doesn't work, just prompts for drawing name: - (setq dn (strcat (getvar "dwgprefix") "New Drawing.dwg")) (vl-propagate 'dn) _.open !dn The saveas & open dialogues look very similar, so please could someone explain why I can reference a variable for the _.saveas filename, but not for the _.open filename, or have I got the syntax completely wrong for the _.open command?
Open Drawing with Vault lisp
SunnyTurtle posted a topic in AutoLISP, Visual LISP & DCLHi i want to replace the _open command this works on my old PC but when i go to install on another it just run the default open is there some variable that stops defun from redefining standard autocad commands ; variables set (setq tilemodevar (getvar "tilemode")) (setq varCPROFILE (getvar "CPROFILE")) ; close windows (COMMAND "EXTERNALREFERENCESCLOSE") (COMMAND "LAYERCLOSE") (COMMAND "PROPERTIESCLOSE") (COMMAND "ADCCLOSE") ; Open drawing from vault (if (= varCPROFILE "Vault_r2014_Acad") (progn (defun c:_open () (command "_vltopen" "" ) ;_ end of command );_ end of defun ) ;_ end of progn ) ; autocad variables unset (setvar "FILEDIA" FILEDIAvar)
Customize File Open Dialog?
ILoveMadoka posted a topic in AutoCAD 2D Drafting, Object Properties & InterfaceWhen I use the open command in Autocad 2013 the following columns are displayed: Name | Date Modified | Type | Size I would like to add Date Created to this dialog so that it appears each time the command is used. I have added it in Windows Explorer and inside the Autocad dialog itself but when I close and relaunch Autocad the "new" column header is gone again. Is this a customizable option so that it remains? Please advise... Thanks!
vl-file-systime does not work on open file
Ahankhah posted a topic in AutoLISP, Visual LISP & DCLHi all, Although vl-file-systime works fine on most files (even readonly ones), it doesn't work on open files. Could any one introduces alternatives to vl-file-systime function to get the time of such files? I appreciate any help and clues to solve the problem
Problem opening an existing drawing ACAD 2014? Help?
tmelancon posted a topic in AutoCAD Bugs, Error Messages & QuirksWe are working with the new AutoCAD 2014 and have been for some time now. We have just started running into this problem; When we try to open up certain existing drawings instead of opening the actual existing drawing it just opens up a blank "Drawing1". We have tried closing out and reopening cad altogether. Tried shutting down. Tried recovering the drawing. Nothing. The same thing happens. The weird thing is that we could have been in that drawing 2 hours ago while it worked just fine. It does not matter how we open up the drawing, it does this. If someone can chime in quickly I would greatly appreciate it. GOD BLESS!
Open Dwg with a lisp
BrianTFC posted a topic in AutoLISP, Visual LISP & DCLAll, I found this Lisp that Renderman wrote; it works great. I was wondering what do i need to do to it so it continues to open the file even if part of the filename changes ie; the date without changing the code everytime it's updated NEW JOB TEMPLATE-7-8-13 - SMALL.dwg (defun c:OpenMyDwg ( / _OpenDwg ) (defun _OpenDwg (dwg readOnly / f oDwg) ;; RenderMan, CADTutor.net ;; Example: (_OpenDwg "FilePath\\FileName.dwg" T) (vl-load-com) (if (and (setq f (findfile dwg)) (/= 1 (getvar 'sdi))) (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) f (cond ((= T readOnly) :vlax-true) ((:vlax-false))))) (cond (f (prompt "\n** Command not available in SDI mode ** ")) ((prompt (strcat "\n** \"" (strcase (vl-filename-base dwg)) "\" cannot be found ** ")))))) (_OpenDwg "F:\\DRAWINGS\\ARCHITECTURAL DETAILS\\NEW JOB\\NEW JOB TEMPLATE-7-8-13 - SMALL.dwg" T) (princ)) Thanks, Brian
open two files in AutoCAD 2010
khoshravan posted a topic in AutoCAD GeneralIn older versions of AutoCAD it was impossible to open two files simultaneously. I think it was added in later versions. Now I am using AutoCAD 2010 but I don't know if I can open two files and shift between them. If it is possible, how can I do that? As a second question in the same subject, is it possible to copy objects from one file to another?
Opening documents with a wildcard character - script
Serabis posted a topic in The CUI, Hatches, Linetypes, Scripts & MacrosI am trying to open up a document in a script routine, and I know the beginning of the file name (and it is unique) but when I add a wildcard character, the script throws an error. For example, say the file name is Project_1-title.dwg, I want to be able to open that file with ' open "Project_1*.dwg" ', or even just Project_1*. Is there any way of doing this, or must you know the entire file name in order to open the document? Thanks in advance. -Serabis
Mission: Get the list of all DBX opened drawings
Ahankhah posted a topic in AutoLISP, Visual LISP & DCLHi all, as you know there is a way to get a list of all opened drawings. (defun Get:OpenDrawings ( / *dwg* *acdocs*) (vlax-for <doc> (MT:vla-get-Documents) (if (eq "" (setq *dwg* (vla-get-fullname <doc>))) (setq *dwg* (vla-get-name <doc>))) (setq *acdocs* (cons (cons (strcase *dwg*) <doc>) *acdocs*)) ) (reverse *acdocs*) ) (Get:OpenDrawings) returns an assoc list of all opened drawings' ((name1 . vla-object1) (name2 . vla-object2) ... (nameN . vla-objectN)) Is there a way to get all opened drawings in current session as ObjectDBX?
Script / Lisp Request : (Open DWG / Run Action / Save DWG) - for Multiple Drawings
haynesc87 posted a topic in AutoLISP, Visual LISP & DCLHello i would like to have a script that can be batch-applied to multiple drawings to do the following: -vports,2,v visretain,0 reload all xrefs save and close Can somebody please help me with this Thanks
How to control OPEN command via reactors?
Ahankhah posted a topic in AutoLISP, Visual LISP & DCLHi CADmates, as most of you know, CommandWillStart and CommandEnded are two reactors triggered just when a command called and a command ended. I am looking for a way to control OPEN command after selecting a drawing and before actually OPENing it. Is this mission possible? Any suggestions and help greatly appreciated.
How to distinguish between Ellipse and Ellipse Arc?
Ahankhah posted a topic in AutoLISP, Visual LISP & DCLHi CADmates, how is it possible to recognize an ellipse object is closed (i.e. full ellipse) or open (i.e ellipse arc)? Any reply appreciated.
How to distinguish a read only drawing without opening it?
Ahankhah posted a topic in AutoLISP, Visual LISP & DCLHi everyone, how is it possible to find out any drawing is read only due to being opened by other one, without opening it?
Close a folder by AutoLISP code
Ahankhah posted a topic in AutoLISP, Visual LISP & DCLHello CADTutor members, I found a code by Lee Mac to open a folder by AutoLISP here. The code follows: (defun MT-Explore (Directory / Shell result) (setq Shell (vla-getInterfaceObject (vlax-get-acad-object) "Shell.Application" ) ) (setq result (vl-catch-all-apply 'vlax-invoke (list Shell 'Explore Directory)) ) (vlax-release-object Shell) (not (vl-catch-all-error-p result)) ) Should anyone know how to close the opened folder?