Direct Modification of KeynoteTable

Direct Modification of KeynoteTable

Anonymous
Not applicable
781 Views
6 Replies
Message 1 of 7

Direct Modification of KeynoteTable

Anonymous
Not applicable

Is there a way to directly change KeynoteEntrys in a KeynoteTable?  I am looking to add to it by creating a new KeynoteEntry, as well as remove entries from it.  Is this possible?  Or is the only way to build up a ne keynote.txt file and load it into the Revit file?

 

Thanks

0 Likes
Accepted solutions (1)
782 Views
6 Replies
Replies (6)
Message 2 of 7

Mustafa.Salaheldin
Collaborator
Collaborator
Accepted solution

Use the KeynoteTable.DeleteEntity() Method and KeynoteEntry constructor method  to do the job.


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

Message 3 of 7

Anonymous
Not applicable

Thank you Mustafa. I saw the KeynoteEntry Constructor, but didn't realize that the constructor added it directly to the table.  Thank you for clarifying this.

Message 4 of 7

Mustafa.Salaheldin
Collaborator
Collaborator

Don't bother. At your service always.


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 5 of 7

Anonymous
Not applicable

I am struggling to actually delete a key from the keytable. I am unable to get the schema needed. When I use the method GetEntitySchemaGuids on the KeyTable, the count on the list of guids returned is 0. The list of keys in the table is over 500. What am I missing to get the schema

0 Likes
Message 6 of 7

Mustafa.Salaheldin
Collaborator
Collaborator

Please provide me with sample of your code so I can help.


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 7 of 7

Anonymous
Not applicable

Thanks.  I am just using the revit addin template. This is in Command.cs

 

{
    [Transaction(TransactionMode.Manual)]
    public class Command : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Application app = uiapp.Application;
            Document doc = uidoc.Document;


            var keyTable = KeynoteTable.GetKeynoteTable(doc);
            var keys = keyTable.GetKeyBasedTreeEntries();
            var entity = keys.FindEntry("3");

            var schema = keyTable.GetEntitySchemaGuids();

            //var delete = keyTable.DeleteEntity();

            return Result.Succeeded;
        }
    }
}
0 Likes