Set Value of Cells in Key Schedule.

Set Value of Cells in Key Schedule.

mohd.fadel
Enthusiast Enthusiast
1,447 Views
2 Replies
Message 1 of 3

Set Value of Cells in Key Schedule.

mohd.fadel
Enthusiast
Enthusiast

Hello,

 

I am trying to create dynamically my schedule key. I have prepared the schedule with all its fields. However, the cells are still empty. I have created a program that would populate these values based on the user's intervention. This is the only link i found:

 

https://forums.autodesk.com/t5/revit-api-forum/add-a-row-to-a-schedule/td-p/7984145

 

Only when i run my add-in using the following code:

 

tsd.SetCellText(tsd.FirstRowNumber + 1, tsd.FirstColumnNumber, "HS1");

 

I get an InvalidOperationException saying that the operation is forbidden for cells in standard schedule body sections. Is this because i'm using Revit 2015?

 

Mohamad,

 

0 Likes
Accepted solutions (1)
1,448 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

Have you done your homework and searched this forum for existing solutions before asking your new question?

 

 

The documentation for the SetCellText method says:

 

 

Remarks

If this cell's type is not CellType.Text, and the operation is permitted on this cell, the cell type will be changed to type CellType.Text as a result of this call.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException The given row number nRow is invalid. -or- The given column number nCol is invalid.
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions InvalidOperationException This operation is forbidden for cells in standard schedule body sections.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 3

mohd.fadel
Enthusiast
Enthusiast

You are right. I saw it but didn't go through it till the end. I set it just like any other parameter.

 

Thank you, and sorry for the trouble.

0 Likes