private void CreateWalls() {
for (int i = 0; i < points.Count; i++) {
if (i % 2 == 1) {
using (Transaction tr = new Transaction(_doc, "Create wall")) {
tr.Start();
string[] start = points[i - 1].Split(' ');
string[] end = points[i].Split(' ');
Line geomLine = Line.CreateBound(new XYZ(double.Parse(start[0].Split('=')[1]),
double.Parse(start[1].Split('=')[1]),
0) / Consts.scale,
new XYZ(double.Parse(end[0].Split('=')[1]),
double.Parse(end[1].Split('=')[1]),
0) / Consts.scale);
walls.Add(Wall.Create(_doc, geomLine, _level.Id, true));
richTextBox1.Text += "Wall created...\n";
tr.Commit();
}
}
}
UIDocument uidoc = new UIDocument(_doc);
UIView uiview = uidoc.GetOpenUIViews().Cast<UIView>().First(q => q.ViewId == _doc.ActiveView.Id);
uidoc.RefreshActiveView();
uiview.ZoomToFit();
}