Hi,
I have the following code which creates an arc in dimension.
How can I remove the "Arc length Symbol" symbol?
using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Geometry; using Autodesk.AutoCAD.Runtime; namespace cota_linear { public class Class1 { [CommandMethod("cotaLinear")] public void cotas() { Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; using (Transaction trans = db.TransactionManager.StartTransaction()) { BlockTable table = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead); BlockTableRecord rec = (BlockTableRecord)trans.GetObject(table[BlockTableRecord.ModelSpace], OpenMode.ForWrite); RotatedDimension dim = new RotatedDimension(); dim.XLine1Point = new Point3d(0, 15, 0); // StartPoint dim.XLine2Point = new Point3d(20, 20, 0); // EndPoint dim.DimLinePoint = new Point3d(55, 20, 0); // Altura da cota dim.SetDatabaseDefaults(); dim.DimensionStyle = db.Dimstyle; rec.AppendEntity(dim); trans.Commit(); } } } }
Solved! Go to Solution.
Solved by Hallex. Go to Solution.
The same way
[CommandMethod("arcdimens")]
public void demo()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database; using (Transaction trans = db.TransactionManager.StartTransaction())
{
BlockTable table = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead);
BlockTableRecord rec = (BlockTableRecord)trans.GetObject(table[BlockTableRecord.ModelSpace], OpenMode.ForWrite); ArcDimension arcdim = new ArcDimension(new Point3d(0,0,0),new Point3d(-10,0,0),new Point3d(10,0,0),new Point3d(0,10,0),"",db.Dimstyle);
rec.AppendEntity(arcdim);
trans.AddNewlyCreatedDBObject(arcdim, true);
trans.Commit();
}
}
This one is without arclength symbol
[CommandMethod("arcdimens")] public void demo2() { Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; using (Transaction trans = db.TransactionManager.StartTransaction()) { BlockTable table = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead); BlockTableRecord rec = (BlockTableRecord)trans.GetObject(table[BlockTableRecord.ModelSpace], OpenMode.ForWrite); ArcDimension arcdim = new ArcDimension(new Point3d(0, 0, 0), new Point3d(-10, 0, 0), new Point3d(10, 0, 0), new Point3d(0, 10, 0), "", db.Dimstyle); arcdim.ArcSymbolType = 2;//0- Preceding dimension text; 1 - Above dimension text; 2 - None rec.AppendEntity(arcdim); trans.AddNewlyCreatedDBObject(arcdim, true); trans.Commit(); } }