hi, gile
I'm trying to load some scripts into cad to draw some lines.
Autocad 2018
.NET framework 4.6.1
C#
I've tried to use (with FILEDIA set to 0)
[CommandMethod("BATCHSCR")]
public void BATCHSCR()
{
Document acDoc = Application.DocumentManager.MdiActiveDocument;
Editor ed = acDoc.Editor;
ed.Command(".script","D:\\123.scr\n ");
ed.Command(".script","D:\\234.scr\n ");
}
only commands in the second script has been executed.
and
[CommandMethod("BATCHSCR")]
public void BATCHSCR()
{
string path1 = @"D:\123.scr";
string path2 = @"D:\234.scr";
acDoc.SendStringToExecute(".script " + path1 + "\n", false, false, false);
acDoc.SendStringToExecute(".script " + path2 + "\n", false, false, false);
}
only commands in the first script has been executed.
Is it possible to load scripts in one customize command ?
Or is it have other solution?
123.scr :
(setq old-osmode(getvar "osmode"))
_osmode 0
_units
2
2
3
4
0
_y
_DIMAUNIT
2
_DIMUNIT
2
_-layer
_n
220427__20220427_2_Report
_c
_red
220427__20220427_2_Report
_s
220427__20220427_2_Report
_POINT
1387480.930000,2623185.220000,0.000000
_POINT
1387602.000000,2623185.220000,0.000000
_-layer
_n
220427__20220427_2_Report
_c
_red
220427__20220427_2_Report
_s
220427__20220427_2_Report
_3DPOLY
1387480.930000,2623185.220000,0.000000
1387602.000000,2623185.220000,0.000000
(setvar "osmode" old-osmode)
234.scr
(setq old-osmode(getvar "osmode"))
_osmode 0
_units
2
2
3
4
0
_y
_DIMAUNIT
2
_DIMUNIT
2
_-layer
_n
220427__20220427_1_Report
_c
_red
220427__20220427_1_Report
_s
220427__20220427_1_Report
_POINT
1387525.930000,2623185.220000,0.000000
_POINT
1387550.000000,2623103.550000,0.000000
_-layer
_n
220427__20220427_1_Report
_c
_red
220427__20220427_1_Report
_s
220427__20220427_1_Report
_3DPOLY
1387525.930000,2623185.220000,0.000000
1387550.000000,2623103.550000,0.000000
(setvar "osmode" old-osmode)