private void applyLineStyle(AC_Entity ent, Color lineColor, string LineStyle, double scale) { ent.Color = lineColor; tr.start_Transaction(); LinetypeTable lintable = tr.AC_Tr.GetObject(tr.AC_Db.LinetypeTableId, OpenMode.ForRead) as LinetypeTable; if (!lintable.Has(LineStyle)) { tr.AC_Db.LoadLineTypeFile(LineStyle, "acad.lin"); } tr.AC_Tr.Commit(); tr.AC_Tr.Dispose(); ent.Linetype = LineStyle; ent.LinetypeScale = scale; }
public void ShowAllTriangulate() { Triangulations triangulation = new Triangulations(); AC_Transactions tr = new AC_Transactions(); Transaction trans = tr.start_Transaction(); tr.openBlockTables(OpenMode.ForRead, OpenMode.ForRead); foreach (ObjectId id in tr.AC_blockTableRecord) { try { AC_Entity ent = (AC_Entity)tr.openObjectErased(id); if (ent.BaseEntity is Line) { AC_Line line = (AC_Line)ent; ResultBuffer rb = line.XData; if (rb != null) { //FIND XDATA GUID int index = 0; string guid = null; foreach (TypedValue tv in rb) { if (index == 3) { guid = tv.Value.ToString(); } index++; } if (guid != null) { triangulation.Show(line); } } } tr.Dispose(trans); } catch { tr.AC_Doc.Editor.WriteMessage("Skipped a not Entity Object"); } } }