比如用记事本打开 c:\1.txt
Process.Start("C:\Windows\notepad.exe", "c:\1.txt")
如何用vb.net编程在cad图形中插入dwg图块?Dim ppr As PromptPointResult = ed.GetPoint("请选择插入点:")
Dim pt As Point3d = ppr.Value
utility.WriteToEditor(pt.ToString())
Dim pidBlock As New PIDBlock()
'自己定义的图块类,保存图块的路径和名称
pidBlock.Name = "sample"
pidBlock.Path = blockPath"b_sample.dwg"
Using blkDb As New Database(False, True)
'read drawing
blkDb.ReadDwgFile(pidBlock.Path, System.IO.FileShare.Read, True, Nothing)
blkDb.CloseInput(True)
Using docLock As DocumentLock = doc.LockDocument()
'多文档要先这样,否则报至命错误
Using t As Transaction = doc.TransactionManager.StartTransaction()
'insert it as a new block
Dim idBTR As ObjectId = doc.Database.Insert(pidBlock.Name, blkDb, False)
'create a ref to the block
Dim bt As BlockTable = DirectCast(t.GetObject(doc.Database.BlockTableId, OpenMode.ForRead), BlockTable)
Dim btr As BlockTableRecord = DirectCast(t.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord)
Using bref As New BlockReference(pt, idBTR)
btr.AppendEntity(bref)
t.AddNewlyCreatedDBObject(bref, True)
End Using
t.Commit()
End Using
End Using
End Using
vb.net查看dwg的介绍就聊到这里吧,感谢你花时间阅读本站内容 , 更多关于vbnetdatagridview查询、vb.net查看dwg的信息别忘了在本站进行查找喔 。
推荐阅读
- 碰磁模拟器游戏下载,碰瓷模拟器方块版
- redis更新性能,redis数据更新准实时刷新缓
- 包含卫滨区网站搭建优化的词条
- 网站虚拟主机怎么用,网站的虚拟主机
- oracle修改连接配置文件,连接oracle数据库的配置文件
- python爬虫暗网的简单介绍
- linux无限循环指命令 linux循环控制语句
- 学习postgresql,学习计划
- phpcms是mvc,最好的phpCMS