.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Arc length Symbol

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
1772 Views, 4 Replies

Arc length Symbol

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();
            }
        }
    }
}

 

4 REPLIES 4
Message 2 of 5
Hallex
in reply to: Anonymous

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();

}

 }

 

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 3 of 5
Hallex
in reply to: Anonymous

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(); 
            } 
        }

 

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 4 of 5
Anonymous
in reply to: Anonymous

 

Grateful friend.

Problem solved.

Message 5 of 5
Hallex
in reply to: Anonymous

Glad to hep

Cheers 🙂

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost