#region Register RegApp public static void Checkregapp (String regapptablename) {Database db = Hostapplicationservices.workingdatabase; using (Transaction trans = db). Transactionmanager.starttransaction ()) {regapptable apptbl = trans. GetObject (db. Regapptableid,openmode.forwrite) as regapptable; if (!apptbl.has (Regapptablename)) {Regapptablerecord apptblrcd = new Regapptablerecord ( ); Apptblrcd.name = Regapptablename; Apptbl.add (APPTBLRCD); Trans. Addnewlycreateddbobject (APPTBLRCD, true); } trans.commit (); } return; } #endregion [Commandmethod ("Mydra")] public static void Mydra () {//Get current database do Cument Acdoc = Application.DocumentManager.MdiActiveDocument; Database Accurdb = acdoc.database; Start a Transaction start transaction using (Transaction Actrans = AcCurDb.TransactionManager.StartTransaction ()) {//Open the Block table for read in read mode blocktable acblktbl; ACBLKTBL = Actrans.getobject (Accurdb.blocktableid, openmode.forread) as blocktable; Open the Block table record model space for write/Modelspace Blocktablerecor D Acblktblrec; Acblktblrec = Actrans.getobject (Acblktbl[blocktablerecord.modelspace], openmode.forwrite) as BlockTableReco Rd Create the radial dimension creates a radius callout radialdimension Acraddim = new Radialdimension (); Acraddim.center = new Point3D (0, 0, 0); Acraddim.chordpoint = new Point3D (5, 5, 0); Acraddim.leaderlength = 5; Acraddim.dimensionstyle = Accurdb.dimstyle; Add new objects to model space and transaction Checkregapp ("Acad_dstyle_dimradial_extension");//Custom Function checks if RegApp name exists, does not exist Add regapp name Resultbuffer resbuf = new Resultbuffer (); Resbuf.add (New Typedvalue ((int) dxfcode.extendeddataregappname, "acad_dstyle_dimradial_extension")); Resbuf.add (New Typedvalue ((int) dxfcode.extendeddatainteger16, 387)); Resbuf.add (New Typedvalue ((int) dxfcode.extendeddatainteger16, 1)); Resbuf.add (New Typedvalue ((int) dxfcode.extendeddatainteger16, 388)); Resbuf.add (New Typedvalue ((int) dxfcode.extendeddatareal, 6.26953));//Start Angle Resbuf.add (New Typedvalue ((int) Dx FCODE.EXTENDEDDATAINTEGER16, 390)); Resbuf.add (New Typedvalue ((int) dxfcode.extendeddatareal, 2.67146));//End angle Acraddim.xdata = resbuf; Acblktblrec.appendentity (Acraddim); Actrans.addnewlycreateddbobject (Acraddim, true); Commit changes, close transaction actrans.commit (); } }
Autocad.net Arc radius Callout Extension Cable