cadplayer Posted February 11, 2016 Posted February 11, 2016 [CommandMethod("xx")] public static void Delete() { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; Database db = Application.DocumentManager.MdiActiveDocument.Database; PromptEntityOptions peo = new PromptEntityOptions("Select A Profile Label Group : "); peo.SetRejectMessage("\nOnly Label is allowed"); peo.AddAllowedClass(typeof(Autodesk.Civil.DatabaseServices.ProfileDataBandLabelGroup), false); PromptEntityResult per = ed.GetEntity(peo); if (per.Status != PromptStatus.OK) return; //start a transaction using (Transaction trans = db.TransactionManager.StartTransaction()) { ProfileDataBandLabelGroup label = trans.GetObject(per.ObjectId, OpenMode.ForWrite) as ProfileDataBandLabelGroup; label.Erase(); trans.Commit(); } } Here is a code, how to delete Bandlabels (ProfileDataBandLabelGroup) from Profilview bands. But I want manipulate the lable contains. So I try to read first the label and then to modify. Is there a way to can do that ? Quote
Tharwat Posted February 12, 2016 Posted February 12, 2016 Hi, I am not a Civil3D guy , but speaking generally if you want to have or see all properties & methods for any object in .NET program, you should be able to have them right after the dot when you type label. in your example. Hope this helps. Quote
BlackBox Posted February 12, 2016 Posted February 12, 2016 Once you've opened 'label' Object ForWrite, you can modify the ProfileDataBandLabelGroup Properties. Tharwat is describing Intellisense - where Visual Studio will show you the Properties, Methods, and Events contextually, based on the Object's derived type. Cheers Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.