可以在加載時(shí)設(shè)置一個(gè)空間 ,沒有菜單,沒有命令窗口,完成后改為普通空間,
成都創(chuàng)新互聯(lián)長(zhǎng)期為1000多家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對(duì)不同對(duì)象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺(tái),與合作伙伴共同營(yíng)造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為平陽(yáng)企業(yè)提供專業(yè)的網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè),平陽(yáng)網(wǎng)站改版等技術(shù)服務(wù)。擁有十年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開發(fā)。
望采納
你去查查書吧,書上挺詳細(xì)的,在這說(shuō)不好說(shuō),你先在項(xiàng)目里引用。然后 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("不能運(yùn)行AutoCAD,請(qǐng)檢查是否安裝了AutoCAD") Exit Sub End If End If AcadApp.Visible = True '界面可視
Dim?ppr?As?PromptPointResult?=?ed.GetPoint("請(qǐng)選擇插入點(diǎn):")
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()
'多文檔要先這樣,否則報(bào)至命錯(cuò)誤?
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對(duì)象中根本不存在組碼這個(gè)東西,一切皆對(duì)象。直接遍歷訪問,要對(duì)應(yīng)組碼有何用?如果你想獲取組碼一句簡(jiǎn)單lsp語(yǔ)句就行了。