AutoCAD Visual LISP / AutoLISP :: Open Drawings In Previous Format Read Only
Nov 21, 2011
I am looking for a way to force all DWG files created with previous versions of AutoCAD to automatically open "Read Only". For example, using Civil 3D 2011, I open a file that is a 2007 format DWG. I want this file to automatically open read only, and inform the user that it has opened read only.
I'm hoping that this is possible, since opening a 2007 format DWG in a newer AutoCAD already tells you that it's an older format in the command line, and files can already be opened as read only.
View 8 Replies
ADVERTISEMENT
Oct 18, 2002
How can you open a drawing read-only with autolisp.
View 9 Replies
View Related
Dec 3, 2012
I want to put the list of open drawings (like the window tab on the menubar has) onto the ribbon? Is this possible?
View 2 Replies
View Related
May 26, 2010
how to make a routine for zoom extents, save all, and close all open drawings in a single routine?
View 3 Replies
View Related
Jan 12, 2012
How to Set a previous selection to nil from say a move command?
View 5 Replies
View Related
Sep 21, 2006
The Field dialog box has an item for CurrentSheetNumber with field expression: %<AcSm Sheet.Number>%
Is it possible to create a Field to display the Next Sheet Number (CurrentSheetNumber + 1) and a Field to display the Previous Sheet Number (CurrentSheetNumber - 1)?
View 1 Replies
View Related
Jun 5, 2012
I wrote (setq oldtext (getvar "textstyle")) to save the current text style,
(setvar "textstyle" (getvar "dimtxsty")) to change the text style to the current dimension text style (which appens to be romans) and later (setvar "textstyle" oldtext) to restore the text style to its original setting but it won't work.
This is the same format used to save and restore osnap in many lisp routines.
When I check the program in the visual lisp editor, oldtext returns "standard" (the original text style - so that part works) but "textstyle" returns nil. I even tried (setvar "textstyle" "standard") to no avail. "Textstyle" remains romans.
View 5 Replies
View Related
Jun 5, 2013
why do not draw the line between ptm1 and pt3?
(defun c:PUNTOM (/ pt1 pt2 pt3) (setq pt1 (getpoint "
Initial point : ")) (setq pt2 (getpoint "
Final point : ")) (setq pt3 (getpoint "
Offset : "))(setq ptm1 (mid (pt1 pt2))) (command "_line" pt1 pt2 "")(command "_line" ptm1 pt3) (princ));;;;;;;(defun mid (p1 p2) (list (/ (+ (car p1) (car p2)) 2.0) (/ (+ (cadr p1) (cadr p2)) 2.0) ));;;;;;;;
View 9 Replies
View Related
Jun 4, 2012
I am using Autocad 2013, and need to have lisp wblock to a 2010 format file. Is there a way I can force it to, without the trouble of opening the file dialog box and setting the format there?
View 4 Replies
View Related
Oct 7, 2013
Is there a way to programatically set a visual style before a drawing actually opens?
We have some huge models and people seem to forget to change their visual styles back to 2D wireframe before saving and exiting drawings. Some models will crash on some workstations when trying to open in a rendered mode.
I found a lisp with a function that looked to set viewport visual styles. But it does not seem to be supported anymore. --> (vla-put-VisualStyle vport 1)
View 9 Replies
View Related
Oct 18, 2012
If I have a CSV file (with no header) that contains three columns and I want to return values of the second column as a list, how is the best method to do that?
I have seen something where one can separate a string into a list by a divider (in my case, the commas between the three columns) but the actual code for me to inspect was supposed to be in an attached ZIP file which I didn't see as part of the post.
An example of my CSV (as a list) wouild be:
("PO-30-10,PIN OAK,88-15" "PO-30-10,PIN OAK,88-01A" "JS-20-5,JUNIPER,63-04" "PP-40-10,POPLAR,38-22")
and I need the resulting list to be:
("PIN OAK" "PIN OAK" JUNIPER" "POPLAR")
Is there a LISP way to do this - or only VLISP?
View 5 Replies
View Related
Apr 9, 2012
For a program i am working for i have to extract the base point of a dynamic block.
This can be done perfectly by this function:
(cdr (assoc 10 (entget (car (entsel)))))
But i want the entity selected based on a previous slected point. So for example when i selected pt1 (which is a point at the border of the dynamic block) i want to be able to extract the base point on the block whit this point.
View 8 Replies
View Related
Dec 15, 2011
(cdr (assoc 1 (entget (entnext (car (entsel))))) ...
gives the string value of the attribute, but i would like to retrieve the field value attached to that attribute.
View 3 Replies
View Related
Nov 22, 2012
How do I check, with LISP, if a System Variable is read only? In particular ANNOTATIVEDWG. This one is read/write when there are no annotative objects in a drawing, but read-only if there are.
View 7 Replies
View Related
Sep 13, 2012
Is it possible to loop through multiple files in a directory?
Like this: (setq file (open "..\TOPO QUADS\*.jgw" "r"))
Windows 7 x 64 Professional
Nvidia Quadro 4000
8 GB Ram
i5 2500 @ 3.30 GHz
Civil 3D 2012 SP 2
Civil 3D 2013 SP 1
View 9 Replies
View Related
Nov 17, 2009
created any script to read GeoTIFF files in order to insert them into a DWG drawing.
I've got a great deal of GeoTIFF files, and I don't want to insert them manually.
View 2 Replies
View Related
Oct 21, 2013
Can a AutoLISP command be written to read an attribute in a block and draw a circle with the attribute as the diameter using variables? The appilcation is taking the diameter of a tree trunk (the attribute), multipling by 12, and drawing the canopy circle on hundreds of those blocks. So the circles drawn will vary in size.
Not sure how this could be set up, i'm not familiar with LISP writing at all.
1) Read block, single, mulitple or definition?
2) Read Attribute
3) Varaible of attribute, (attribute is an inch measurement...it needs to be multipled by 12 to get feet for final use as circle diameter drawn)
4) Draw circle, variable, with diameter coming from attribute variable (attribute in inches that is multipled by 12)
5) Center point or circle to be block's base point
View 9 Replies
View Related
Mar 21, 2012
I have some numeric data like 1, 2, 3, 4, 5 in mtext format in autocad drawing file and some numeric data like 1,2, 3 in notepad.
How can i get the remaining numeric data of autocad dwg into another notepad using autolisp or visual lisp
View 6 Replies
View Related
Oct 24, 2013
I'm looking to draw a mleader (with a leader style CLL_Anno) using the block basepoint as insertion point, read two attributes from that block and use those as the text for the mleader. for example: "attribute - attribute". Attached is dwg with blocks with attributes and leader style. (Block is "Trees", Attributes are "V_SPECIES" "V_DBH_DIM")
View 2 Replies
View Related
Jul 18, 2012
I have to go into approx 600 3D Models and rotate them all by 90.
I've just tried to search for a lisp that will do this to all of these files in one directory and can't find one. Something that will do this and save loads of time. I need to do this tonight so that these MEP files will all be ready for tomorrow morning.
View 1 Replies
View Related
Oct 19, 2011
I am trying to save a *.DWG file to *.DXF format. The DXF file is created, but when i tried to open the same DXF file in AutoCAD,it is showing as "not a Valid DXF file".
Code :
// Open *.DWG file
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open("....abc.dwg",true);
// Save to *.DXF format
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database.Saveas("....def.dxf",Autodesk.AutoCAD.DatabaseServices.DwgVersion.Current);
// Close and discard changes,if any
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.CloseAndDiscard();
When i used the save as command in Autocad, it is showing different dxf file formats(AutoCAD 2010 DXF,AutoCAD 2007 /LT 2007 DXF etc..). How to save in particular DXF format. If possible give me a sample C# code for this.
View 6 Replies
View Related
Jul 22, 2013
I am writing a program to grab a bunch of layers from a list, check a drawing to see if the layers are on the list, and if not save to an external file. I have the second part of the program done, but I can't get the first part to work.
I am trying to open a file read the contents and save it to a list.
Here is the code I have so far, but it doesn't even get into the foreach statement.
(setq layerslist (list '"0list" '"detaillist" '"clearancelist" '"clearanceelist" '"doorsdrawerslist" '"hiddenlist" '"hiddenelist" '"deletelist"))(setq count 0)(foreach thislayer layerslist (setq f (open (strcat "C:\filterlists\" thislayer ".txt") "r")) (while (/= (setq text (read-line f)) nil) (setq (read thislayer) (cond ( (= 0 count) (cons (cons 8 text) (read thislayer)))( (append (read thislayer) (list (cons 8 text))) ) );cond );setq (setq count (+ count 1)) );while (close f) );foreach
I've also attached one of the text files. Im doing something in the wrong order, or I have something inside the wrong set of parenthesis.
View 2 Replies
View Related
Sep 18, 2012
Is it possible to write a Macro in the CUI that opens a drawing in Read-Only mode? Limitation : AutoCAD LT.
View 7 Replies
View Related
Nov 6, 2013
(setq plist (vl-directory-files (getvar "dwgprefix") "*.dwg" 1))
(foreach ins1 plist
(setvar "lispinit" 0)
(command "open" ins1)
(command "insert" "C:UsersasmoleyDesktopBSK100_BD" "0.875,0.28125")
(command "save" ins1)
);foreach
(setq plist nil)
bad variable name in SETQ and malformed string on input errors.
View 1 Replies
View Related
Jan 22, 2013
I have a lot of drawings with two tables in them, and they are all over the place.
I'm able to change the columns widths using the following
(setq PipeList (vlax-ename->vla-object (car (entsel))))
(vla-setcolumnwidth PipeList 0 0.25)
(vla-setcolumnwidth PipeList 1 0.25)
(vla-setcolumnwidth PipeList 2 2.0)
(vla-setcolumnwidth PipeList 3 1.5)
(vla-setcolumnwidth PipeList 4 1.625)
(vla-setcolumnwidth PipeList 5 1.0)
(vla-setcolumnwidth PipeList 6 1.75)
I'm wondering if I could modify the assoc 10 value to a specific point of '(8.5 10.3675 0.0).
View 3 Replies
View Related
Dec 16, 2011
This probably isn't the correct discussion group but not sure where else to post this.
My sales department wants to be able to create drawings based on entries in selected in their Excel qouting tool. Basically, they want to configure a product in the field, and be able to show the customer the drawing with TrueView. (They don't have AutoCAD installed).
I would think the best I can do, is manipulate a .dxf file based on their selections but that may get very complicated.
View 2 Replies
View Related
Nov 6, 2013
I have some drawing that contains PHANTOM2 linetype.
I can't delete this linetype from my drawings!
View 9 Replies
View Related
Aug 2, 2013
Any way to insert a block onto many different drawings quickly? I have a title block I need to insert into about 100 drawings. It seems very tedious to open each drawing and insert 100 times.
View 3 Replies
View Related
Dec 5, 2012
I have the following string of code, that I'll write in everyone's start-up suite. I'm able to retrieve a list of files I want to modify, for whatever reason. (One example, when plotting drawings with layouts, sometimes the shadeplot setting is wireframe, and not classic hidden, though it's been set up in our templates).
The huge question is, can I get a list of drawings to a variable in one drawing, and have access to that variable list, in the next drawing I open? I'll iron out the bugs on read-only statuses, or manipulating drawing states later.
(defun GetDrawings ()
(setq currentpath (getvar "dwgprefix"))
(command "pspace")
(setq DrawingList (dos_getfilem "Select a file" currentpath "Drawing files (*.dwg)|*.dwg|All files (*.*)|*.*||"))
(setq ListOfDrawings (cdr DrawingList))
(setq DrawingPath (nth 0 DrawingList))
[code]...
View 1 Replies
View Related
Dec 31, 2013
I searched the groups and the closest discussion I could find was here but there didn't seem to be a clear cut solution. [URL]. I have a jpg file that I needed to apply some transparency to and saved it as a png file. I now want to delete the jpg file from the folder but it's being referenced in several drawings, and I don't know which ones. Is there a way to reverse the function of Reference Manager (perhaps with a different app), ie find all the drawing files that reference my jpg file?
Intel i7 3.33Ghz, 16Gb RAM
Nvidia Quadro 2000D
C3D 2012 SP4, holding off on C3D 2014
Win 7-64
View 3 Replies
View Related
Aug 30, 2012
Routine to select DWG files in a folder and save these files in DXF format?
1) Select files in folder;
2) Open select files, save each in dxf format; If there is already a dxf file with the same name, replace.
3) Close files.
View 4 Replies
View Related