当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > 在VBA中调用AUTOCAD打印文件

ASP.NET
调用另外一个同名的重载函数漏掉括号出现的严重问题
DataGrid模板列应用:在DataGrid中用CheckBox控制TextBox的Enabled属性
使用存储过程的一个小例子
.net中xmlhttp下载文件的方法参考
简单的c#文本文件读写
我的C#学习过程 第一天 安装
在数据库中开始一个事务。
用ASP.NETt实现简单的文字水印
C/S系统中三层结构(Com/Com+)的测试成功实现
VB 二进制块读写类模块应用实例,包括一个文件拷贝和一个文件二进制比较的例子。
扫雷程序“布雷”代码(vb)
关于网络连接状态的编程
c#中ref和out参数使用时需要注意的问题
use Assembly to call a method
在VBA中调用AUTOCAD打印文件
在VS.NET的
昨天折腾了一晚上,哪位高手帮我看看!急!
Net是未来的趋势吗?
如何修改自定义Webpart 的标题(downmoon)
[收藏]ASP.Net生成静态HTML页 选择自 coofucoo 的 Blog

ASP.NET 中的 在VBA中调用AUTOCAD打印文件


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 56 ::
收藏到网摘: n/a


花了一下午完成了一个初步的示范的例子,看来解决图纸统一管理有了解决的办法了.下一步用jacob封装在java中调用,在服务器上控制打印管理.做个记号再慢慢完善.
'取得当前文档对象(vba中的方法,如果是在VB中时需要从顶层对象开始引用取得)Dim currentDoc As AcadDocumentSet currentDoc = ThisDrawing
'文档的模型空间Dim sp As AcadModelSpaceSet sp = currentDoc.modelspace
'取得模型空间中的块属性Dim index As IntegerFor index = 0 To sp.Count - 1 Dim name As String name = sp.Item(index).ObjectName '判断模型空间中的项目是否是一个块引用 If name Like "*Ac*" Then Dim blockRef As AcadBlockReference Set blockRef = sp.Item(index) '块引用的插入点 Dim insertPoint As Variant insertPoint = blockRef.InsertionPoint '放大比例 Dim xScale, yScale As Integer xScale = blockRef.XScaleFactor yScale = blockRef.YScaleFactor '宽高基数 Dim width, height As Double width = 297 height = 210 '打印区域 Dim UpperRight(0 To 1) As Double, LowerLeft(0 To 1) As Double UpperRight(0) = insertPoint(0) UpperRight(1) = insertPoint(1) LowerLeft(0) = insertPoint(0) + width * xScale LowerLeft(1) = insertPoint(1) - height * yScale

list.AddItem "inserPoint:X=" & UpperRight(0) & " Y:" & UpperRight(1) list.AddItem "lowerLeft :X=" & LowerLeft(0) & " Y:" & LowerLeft(1) Dim plotConfs As AcadPlotConfigurations Set plotConfs = ThisDrawing.PlotConfigurations list.AddItem plotConfs.Count Dim plotconf As AcadPlotConfiguration Set plotconf = plotConfs.Add("plot") 'list.AddItem plotconf.GetPlotDeviceNames(5) 'Set plotConf = ThisDrawing.PlotConfigurations.Add '设置定义要打印的布局范围的坐标 ThisDrawing.ActiveLayout.SetWindowToPlot LowerLeft, UpperRight '指定布局或打印配置的类型 ThisDrawing.ActiveLayout.PlotType = acWindow '按局部或完整视图预览方式显示打印预览对话框 ThisDrawing.Plot.DisplayPlotPreview acFullPreview '打印布局到设备 ThisDrawing.Plot.PlotToDevice End If Next index