Jump to content

Recommended Posts

Posted

        [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 ?

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...