D=AcadApp.ActiveDocument.Utility.GetPoint(,"选择一个点:")
洪江网站建设公司创新互联,洪江网站设计制作,有大型网站制作公司丰富经验。已为洪江近千家提供企业网站建设服务。企业网站搭建\外贸网站建设要多少钱,请找那个售后服务好的洪江做网站的公司定做!
你的参数没有弄对
GetPoint是个方法不是属性必须要括号()
他的两个参数为可选参数(startpoint,prompt)第一个参数是起始点,第二个参数是提示语
lisp写的,原理很简单,你可以用VB再写一个,源代码直接用文本就可打开
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
利用CAD对象捕捉功能。通过查询netcadgetpoint官网得知,vbnetcadgetpoint可以利用CAD对象捕捉功能才能选切点,vbnetcadgetpoint在新基建工程对话框当选择工程部类为Visual Basic工程。
售后响应及时
7×24小时客服热线数据备份
更安全、更高效、更稳定价格公道精准
项目经理精准报价不弄虚作假合作无风险
重合同讲信誉,无效全额退款