File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -262,6 +262,31 @@ public void Test_BlockFile()
262262 tr . CurrentSpace . InsertBlock ( Point3d . Origin , id ) ;
263263 }
264264
265+ [ CommandMethod ( nameof ( Test_BlockFiledxf ) ) ]
266+ public void Test_BlockFiledxf ( )
267+ {
268+ string [ ] files ;
269+ var folder = new System . Windows . Forms . FolderBrowserDialog ( ) ;
270+ if ( folder . ShowDialog ( ) == System . Windows . Forms . DialogResult . OK )
271+ {
272+ files = Directory . GetFiles ( folder . SelectedPath , "*.dxf" , SearchOption . AllDirectories ) ;
273+ using DBTrans tr = new ( ) ;
274+ foreach ( var item in files )
275+ {
276+ var id = tr . BlockTable . GetBlockFrom ( item , false ) ;
277+ var pt = Env . Editor . GetPoint ( "pick pt" ) ;
278+ if ( pt . Status == PromptStatus . OK )
279+ {
280+ tr . CurrentSpace . InsertBlock ( pt . Value , id ) ;
281+ Env . Editor . Redraw ( ) ;
282+ }
283+
284+ }
285+
286+ }
287+
288+
289+ }
265290
266291 [ CommandMethod ( nameof ( Test_ClipBlock ) ) ]
267292 public void Test_ClipBlock ( )
You can’t perform that action at this time.
0 commit comments