vb.net打印cad vb打印代码怎么写

VS2005如何用VB.NET代码实现打印功能有个PrintDocument控件,可以实现打印 。。。
MSDN原话:
使用 PrintDocument 组件
涉及 PrintDocument 组件的两种主要情况是:
简单的打印作业,如打印单个文本文件 。在这种情况下,应将 PrintDocument 组件添加到 Windows 窗体,然后在 PrintPage 事件处理程序中添加打印文件的编程逻辑 。该编程逻辑应以使用 Print 方法打印文档结束 。
此方法向打印机发送一个 Graphics 对象,该对象包含在 PrintPageEventArgs 类的 Graphics 属性中 。
有关如何使用 PrintDocument 组件打印文本文档的示例 , 请参见
如何:打印 Windows 窗体中的多页文本文件 。
更为复杂的打印作业,如想要重新使用已编写的打印逻辑的情况 。
在这种情况下,应从 PrintDocument 组件派生一个新组件,并重写
(请参见 Visual Basic 的 重写或 C# 的 重写) PrintPage 事件 。
将 PrintDocument 组件添加到窗体后,它出现在 Windows 窗体设计器底部的栏中
如何使用vb.net调用cad进行绘图你去查查书吧vb.net打印cad,书上挺详细的vb.net打印cad,在这说不好说,你先在项目里引用 。然后 Dim acadapp As AcadApplication Dim acaddoc As AcadDocument On Error Resume Next AcadApp = GetObject(, "AutoCAD.Application") If Err.Number Then Err.Clear() AcadApp = CreateObject("AutoCAD.Application") If Err.Number Then MsgBox("不能运行AutoCAD,请检查是否安装了AutoCAD") Exit Sub End If End If AcadApp.Visible = True '界面可视
vb.net 打印功能可以把数据导出到EXCEL,然后使用EXCEL进一步处理后使用 。
也可以做成vb报表(VB自带有) 。
先设置报表格式,打印时向报表传递数据就可以了 。
如何用VB.NET编程语言实现打开CAD文件?需要解析CAD文件的构成 然后根据规则绘制 说白点CAD文件是人家公司定义的一个文件格式 里面保存的不是图形 而是图形的绘制规则 程序AutoCad打开文件的时候是读取文件里面描写的绘制规则绘制图案的 你了解了CAD文件的构成后就可以自己写代码绘制图形了(具体CAD图形构成没研究过 你可以用记事本打开一个CAD的图形交换文件.Dxf 可以看到 这个文件是由图层说明和很多点坐标组成的)
在vb中如何调用autocad进行打印''''取得当前文档对象 VB a中的方法,如果是在VB中时需要从顶层对象开始引用取得)
Dim currentDoc As AcadDocument
Set currentDoc = ThisDrawing
''''文档的模型空间
Dim sp As AcadModelSpace
Set sp = currentDoc.modelspace
''''取得模型空间中的块属性
Dim index As Integer
For 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
【vb.net打印cad vb打印代码怎么写】vb.net打印cad的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vb打印代码怎么写、vb.net打印cad的信息别忘了在本站进行查找喔 。

    推荐阅读