[求助] 如何加载外部dwg图形
如何吧此代码专为VBA ,如何使用外部参照,我把块保存到init.dwg将图形作为块插入时,块和所有关联的几何图形都存储在当前的图形数据库中。更改初始图形时它并不会更新。但是,如果将图形作为外部参照插入,它就会随着原始图形的更改而更新。因此,包含外部参照的图形总是反映每个外部参照文件的最新编辑。
(setq fil_loc (findfile "init.dwg"))<BR> (command "_.insert" fil_loc '(0 0) 1 1 0) ' Define external reference to be inserted<BR> Dim InsertPoint(0 To 2) As Double<BR> InsertPoint(0) = 0: InsertPoint(1) = 0: InsertPoint(2) = 0<BR> <BR> ' Add the external reference to the drawing<BR> Set insertedBlock = ThisDrawing.ModelSpace.AttachExternalReference(PathName, Name, InsertPoint, 1, 1, 1, 0, False) 好东西,学习,哈哈 Dim blockRefObj1 As AcadBlockReference<BR> insertionPnt(0) = 200<BR> insertionPnt(1) = 250<BR> insertionPnt(2) = 0<BR> 'Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "e:\新代码\xwfh.dwg", 1#, 1#, 1#, 0)<BR> Set blockRefObj1 = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "xwfh_qtd", 1#, 1#, 1#, 0)<BR>
页:
[1]