[求助]版本号的问题
<p>在我的2008的版本CAD中</p><p> </p>
<p><font face="Verdana">AutoCAD 2000/LT2000 图形(*.dwg) 的版本号是<font face="Verdana">DwgVersion.AC1015</font></font></p>
<p> </p>
<p><font face="Verdana"><font face="Verdana">AutoCAD 2004/LT2004 图形(*.dwg) 的版本号是<font face="Verdana"><font face="Verdana">DwgVersion.AC1800</font></font></font></font></p>
<p> </p>
<p><font face="Verdana">AutoCAD 2007 图形(*.dwg)<font face="Verdana">的版本号是<font face="Verdana"><font face="Verdana"><font face="Verdana">DwgVersion.Current</font></font></font></font></font></p>
<p> </p>
<p>那么<font face="Verdana">AutoCAD R14/LT98/LT97 图形(*.dwg)的版本代码是什么呢?我试了所有的可以取的枚举变量。从AC1001到1014都试过了,都不可以。</font></p>
<p> </p>
<p>请高手指点我下。</p> <table class="Table4" cellspacing="0">
<tbody>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1001 = 8 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1002 = 9 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267">AutoCAD 2.5 </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1003 = 10 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267">AutoCAD 2.6 </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1004 = 11 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267">Release 9 </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1005 = 12 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1006 = 13 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267">Release 10 </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1007 = 14 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1008 = 15 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1009 = 0x10 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267">R11 and R12 </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1010 = 0x11 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1011 = 0x12 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1012 = 0x13 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267">R13 </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1013 = 20 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1014 = 0x15 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267">R14 </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1015 = 0x17 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1021 = 0x1b </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267">2007 Final </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1500 = 0x16 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1800 = 0x19 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1800a = 0x18 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267">2004 Final </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1To2 = 1 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1To40 = 2 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC1To50 = 3 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC2100a = 0x1a </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC2To10 = 5 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC2To20 = 4 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC2To21 = 6 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr>
<tr>
<td class="Element262" valign="top" width="50%">
<div class="Element263">AC2To22 = 7 </div></td>
<td class="Element266" valign="top" width="50%">
<div class="Element267"> </div></td></tr></tbody></table><a name="4465736372697074696F6E"></a>
<div class="Element14"> </div> 雪山飞狐_lzh 发表于 2010-6-4 17:15 static/image/common/back.gif
AC1001 = 8
我想请教下你。。如果我已知一个*.dwg文件,如何得到该文件的版本号啊???得到DWG文件的版本号、、、谢谢。。。。 本帖最后由 sieben 于 2012-3-12 18:00 编辑
不打开文件获取版本号
/// <summary>
/// 获取Dwg文件的版本字符串
/// 从第0位开始,读入6个字节
/// Version:2011.10.23 Sieben
/// 备注:
/// 1,内容没有加密
/// </summary>
/// <param name="fileName">dwg文件全名</param>
/// <returns>成功返回Dwg文件的版本字符串,举例:AC1021</returns>
public static string GetDwgVersion(string fileName)
{
try
{
if (!System.IO.File.Exists(fileName)) return "";
if (!fileName.Split('.').Equals("Dwg", StringComparison.OrdinalIgnoreCase)) return "";
FileStream dwgStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);//文件流
BinaryReader binReader = new BinaryReader(dwgStream);
dwgStream.Seek(0, SeekOrigin.Begin);//从第0位开始
try
{
byte[] byteArr = binReader.ReadBytes(6);//读入6个字节
StringBuilder strB = new StringBuilder();
foreach (byte b in byteArr)
{
strB.Append(Convert.ToChar(b));
}
return strB.ToString();
}
catch { return ""; }
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
return "";
}
} 软件的版本号
1, public static System.Version Version { get; }
Autodesk.AutoCAD.ApplicationServices.Application 的成员
2, 系统变量 ACADVER 本帖最后由 sieben 于 2012-3-12 18:33 编辑
已打开Dwg文件从Database获取版本号
public Autodesk.AutoCAD.DatabaseServices.DwgVersion OriginalFileVersion { get; }
Autodesk.AutoCAD.DatabaseServices.Database 的成员
public Autodesk.AutoCAD.DatabaseServices.DwgVersion OriginalFileSavedByVersion { get; }
Autodesk.AutoCAD.DatabaseServices.Database 的成员
public Autodesk.AutoCAD.DatabaseServices.DwgVersion LastSavedAsVersion { get; }
Autodesk.AutoCAD.DatabaseServices.Database 的成员 sieben 兄回答的很详细,谢谢
页:
[1]