Created
February 24, 2014 19:51
-
-
Save Civil3DToolChest/9195691 to your computer and use it in GitHub Desktop.
get General Note Style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Autodesk.AutoCAD.DatabaseServices.ObjectId getGeneralNoteStyle(string gnName) | |
{ | |
Autodesk.AutoCAD.ApplicationServices.Document acadDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; | |
Autodesk.Civil.ApplicationServices.CivilDocument civilDoc = Autodesk.Civil.ApplicationServices.CivilApplication.ActiveDocument; | |
Autodesk.AutoCAD.DatabaseServices.ObjectId generalNoteStyleId = Autodesk.AutoCAD.DatabaseServices.ObjectId.Null; | |
using (Autodesk.AutoCAD.DatabaseServices.Transaction trans = acadDoc.Database.TransactionManager.StartOpenCloseTransaction()) | |
{ | |
foreach (Autodesk.AutoCAD.DatabaseServices.ObjectId gnsId in civilDoc.Styles.LabelStyles.GeneralNoteLabelStyles) | |
{ | |
Autodesk.Civil.DatabaseServices.NoteLabel gns = gnsId.GetObject(Autodesk.AutoCAD.DatabaseServices.OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.NoteLabel; | |
if (gnName == gns.Name) | |
{ | |
generalNoteStyleId = gnsId; | |
} | |
} | |
trans.Commit(); | |
} | |
return generalNoteStyleId; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment