根据用户选择批量提取scheme语句https://www.bilibili.com/video/BV1FW4y1C7DT/
var draftApp = new MarDrafting();
var marui = new MarUi();
var marUti = new MarUtil();
bool flag = true;
MarElementHandle lastHandle=new MarElementHandle();
while (flag)
{
MarModel mm = new MarModel();
var marhullp = new MarHullPan();
var panelsch = new MarPanelSchema();
var pt = new MarPointPlanar();
var rtn = marui.PointPlanarReq("选择板架上的构件", pt);
flag = rtn == marUti.Ok();
if (flag)
{
if (lastHandle.handle!=0) draftApp.HighlightOff(lastHandle);
var hd = draftApp.ModelIdentify(pt, mm);
lastHandle = draftApp.ModelHighlight(mm);
string C = marhullp.StmtGet(mm.Name, marhullp.GroupGet(mm.Name, mm.PartId));
panelsch.PanelName = mm.Name;
wm.StatusBar.Text = mm.Name;
var sts = panelsch.GetStatements();
using (StreamWriter sw = new StreamWriter($@"c:\{mm.Name}.txt"))
{
for (int i = 0; i < sts.GetLength(0); i++)
{
for (int j = 0; j < sts.GetLength(1); j++)
{
sw.WriteLine(sts[i, j]);
}
}
}
}
}