关于vb.net输出dxf的信息

vb.net如何在编程中获取CAD对象的DXF组码感觉 vb.net对象中根本不存在组码这个东西,一切皆对象 。直接遍历访问 , 要对应组码有何用?如果你想获取组码一句简单lsp语句就行了 。
在VB中利用cad二次开发画的图如何自动保存为dxf文件object.SaveAs FileName, FileType [, SecurityParams]
Object
Document, MenuGroup
The object or objects this method applies to.
Note This method has no effect for menu groups.
FileName
String; input-only
The full path and file name, or valid URL address, for the file. The active document takes on the new name.
FileType
AcSaveAsType enum; input-only; optional for Document objects
acR14_dwg
AutoCAD R14 DWG (*.dwg)
ac2000_dwg
AutoCAD 2000 DWG (*.dwg)
ac2000_dxf
AutoCAD 2000 DXF (*.dxf)
ac2000_Template
AutoCAD 2000 Drawing Template File (*.dwt)
ac2004_dwg
AutoCAD 2004 DWG (*.dwg)
ac2004_dxf
AutoCAD 2004 DXF (*.dxf)
ac2004_Template
AutoCAD 2004 Drawing Template File (*.dwt)
ac2007_dwg
AutoCAD 2007 DWG (*.dwg)
ac2007_dxf
AutoCAD 2007 DXF (*.dxf)
ac2007_Template
AutoCAD 2007 Drawing Template File (*.dwt)
acNative
A synonym for the latest drawing release. In this release, this value equals ac2007_dwg.
vb.net能否生成dxf文件?从你贴的链接教程来看,所谓的dxf文件本质上就是文本文件,因此扩展名可以是任意的,完全没问题 。
如何利用vb读取一个dxf格式的图形文件的数据dxf文件是AutoCad的交换文件,可以直接用AutoCad打开 。dxf文件是明码文件 , 在vb环境下按顺序文件读取就可以了 。
例如:在C盘根目录下有一个文件“1.dxf”
启动vb后,建立一个按钮:Command1
并双击此按钮,对其输入以下代码:
Private Sub Command1_Click()
Dim a As String '读取文件一行的内容
Dim i As Long '用于记录行数
Dim j As Long '用于记录用户如何响应提示
Open "c:\1.dxf" For Input As #1
i = 0
While Not EOF(1)
Line Input #1, a
i = i + 1
j = MsgBox("第 "i" 行内容为:"a, vbOKCancel + vbInformation)
'运行到此步时,如果用户输入“确定”则继续,如果用户输入“取消”则结束本程序
'用户可以在此输入处理代码,对读入的字串进行处理
If j = vbCancel Then
End
End If
Wend
close #1
End Sub
VB.net 导入DXF文件Imports System.IO
Imports System.Drawing
Public Class PreViewDWG
Private Structure BITMAPFILEHEADER
Dim bfType As Short
Dim bfSize As Integer
Dim bfReserved1 As Short
Dim bfReserved2 As Short
Dim bfOffBits As Integer
End Structure
Public Function GetDwgImage(ByVal FileName As String) As Image
If Not File.Exists(FileName) Then Exit Function
Dim DwgF As FileStream'文件流
Dim PosSentinel As Integer'文件描述块的位置
Dim br As BinaryReader'读取二进制文件
Dim TypePreview As Integer '缩略图格式
Dim PosBMP As Integer '缩略图位置
Dim LenBMP As Integer '缩略图大小
Dim biBitCount As Short '缩略图比特深度
Dim biH As BITMAPFILEHEADER 'BMP文件头,DWG文件中不包含位图文件头,要自行加上去
Dim BMPInfo() As Byte'包含在DWG文件中的BMP文件体
Dim BMPF As New MemoryStream'保存位图的内存文件流
Dim bmpr As New BinaryWriter(BMPF) '写二进制文件类
Dim myImg As Image
Try
DwgF = New FileStream(FileName, FileMode.Open, FileAccess.Read)'文件流
br = New BinaryReader(DwgF)
DwgF.Seek(13, SeekOrigin.Begin) '从第十三字节开始读取
PosSentinel = br.ReadInt32 '第13到17字节指示缩略图描述块的位置

推荐阅读