CAD中缺少dfst.dll文件的解决办法

 CAD2007 中dfst.dll文件找不到,其实是病毒。那天安装AutoCAD2007,装到一半的时候,安装进程提示:错误1308。源文件未找到:G:\AutoCAD2007简体中文版\Bin\acadFeui\Program Files\Root\Support\dfst.dll。请确定文件存在并有权访问。小心了,这个dfst.dll是一个捆绑广告病毒。千万不要傻乎乎地再去网上下载,然后安装了。此时,下面还有三个选项:“中断”“重试”“忽略”。直接选择“忽略”,继续下一步安装,就可以了。

本人实践表明,安装后,AutoCAD一切正常,使用OK。

或者,直接找到dfst.dll文件所在路径,在所在路径下面创建一个记事本文本文档,空的!然后重命名,改成dfst.dll文件即可。
 

Java可以通过调用CAD文件的开放式API接口,将CAD图纸导入到Java项目进行展示、分析和编辑。这需要使用支持CAD文件的第三方Java库,如AutoCAD Java API、dwgPlotX Java Edition和CADSoftTools Java API等。 有关AutoCAD Java API的示例代码如下: ```java import com.autodesk.autocad.application.IAcadApplication; import com.autodesk.autocad.databaseServices.BlockTable; import com.autodesk.autocad.databaseServices.Database; import com.autodesk.autocad.databaseServices.DBObject; import com.autodesk.autocad.databaseServices.DBObjectIterator; import com.autodesk.autocad.databaseServices.DwgFileHandle; import com.autodesk.autocad.databaseServices.Entity; import com.autodesk.autocad.databaseServices.LayerTable; import com.autodesk.autocad.databaseServices.Layout; import com.autodesk.autocad.databaseServices.ModelSpace; import com.autodesk.autocad.databaseServices.ObjectId; import com.autodesk.autocad.databaseServices.Polyline; import com.autodesk.autocad.databaseServices.Polyline2d; import com.autodesk.autocad.databaseServices.Polyline3d; import com.autodesk.autocad.databaseServices.Viewport; import com.autodesk.autocad.geometry.Point2d; import com.autodesk.autocad.geometry.Point3d; import com.autodesk.autocad.runtime.ErrorStatus; import com.autodesk.autocad.runtime.ExtensionDictionary; import com.autodesk.autocad.runtime.Interop; import com.autodesk.autocad.runtime.ResultBuffer; import com.autodesk.autocad.runtime.Variant; public class AutoCADDrawing { public static void main(String[] args) { IAcadApplication app = null; try { app = Interop.getAcadApplication(); if (app != null) { Database db = app.getDocumentManager().getActiveDatabase(); BlockTable bt = db.getBlockTableId().open(BlockTable.class, false); Entity ent = null; Polyline plc = null; Polyline2d p2d = null; Polyline3d p3d = null; LayerTable lt = db.getLayerTableId().open(LayerTable.class, false); Layout lo = db.getLayout("Model"); ObjectId objId = lo.getObjectId(); ModelSpace ms = objId.open(ModelSpace.class, false); Viewport vp = null; DBObjectIterator vit = null; DBObject obj = null; ExtensionDictionary ed = null; ResultBuffer rb = null; Variant vDrawingScale = null; String sLayerName = null; int iColor = -1; short iLineWeight = -1; Point3d pt1 = null, pt2 = null; Point2d p2dfst = null, p2dscd = null; System.out.println("Blocks in drawing:"); for (ObjectId id : bt) { System.out.println(id.getHandle()); } System.out.println("Layers in drawing:"); for (ObjectId id : lt) { System.out.println(id.getHandle()); } System.out.println("Entities in ModelSpace:"); vit = ms.newObjectIterator(); while (vit.hasNext()) { obj = vit.next(); if (obj instanceof Polyline) { plc = (Polyline) obj; System.out.println("Polyline found on Layer: " + plc.getLayer()); System.out.println("Polyline vertices:"); for (int i = 0; i < plc.getNumberOfVertices(); i++) { pt2 = plc.getPointAt(i); System.out.println("Vertex " + i + ": (" + pt2.getX() + "," + pt2.getY() + ")"); } } else if (obj instanceof Polyline2d) { p2d = (Polyline2d) obj; System.out.println("Polyline2d found on Layer: " + p2d.getLayer()); System.out.println("Polyline2d vertices:"); for (int i = 0; i < p2d.getNumberOfVertices(); i++) { p2dfst = p2d.getVertexAt(i); System.out.println("Vertex " + i + ": (" + p2dfst.getX() + "," + p2dfst.getY() + ")"); } } else if (obj instanceof Polyline3d) { p3d = (Polyline3d) obj; System.out.println("Polyline3d found on Layer: " + p3d.getLayer()); System.out.println("Polyline3d vertices:"); for (int i = 0; i < p3d.getNumberOfVertices(); i++) { pt2 = p3d.getPointAt(i); System.out.println("Vertex " + i + ": (" + pt2.getX() + "," + pt2.getY() + "," + pt2.getZ() + ")"); } } else if (obj instanceof Viewport) { vp = (Viewport) obj; System.out.println("Viewport found on Layer: " + vp.getLayer()); System.out.println("Viewport position and size: " + vp.getLowerLeftCorner().toString() + ", " + vp.getUpperRightCorner().toString()); } else { System.out.println(obj.getHandle() + ": " + obj.getClass().getName()); } } } } catch (UnsatisfiedLinkError e) { System.out.println("AutoCAD isn't running"); } catch (ErrorStatus e) { System.out.println(e.name()); } finally { if (app != null) { DwgFileHandle dwg = app.getActiveDocument().getDwgFileHandle(); System.out.println("Drawing name is " + dwg.getFileName()); } } } } ``` 该示例代码利用AutoCAD Java API遍历了当前AutoCAD文档的块、图层、布局、视口和实体,并获取了它们的属性和坐标信息,可以为Java开发人员提供了一种方便快捷的方式来解析和操作CAD图纸。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值