How can I create a new Sheet List Schedule?

b_ralphs
Advocate
Advocate

How can I create a new Sheet List Schedule?

b_ralphs
Advocate
Advocate

I've had a look at the "ScheduleCreation" sample provided in the SDK & I've tried changing this line:

 

ViewSchedule schedule = ViewSchedule.CreateSchedule(document, new ElementId(BuiltInCategory.OST_Walls), ElementId.InvalidElementId);

 

to this:

 

ViewSchedule schedule = ViewSchedule.CreateSchedule(document, new ElementId(BuiltInCategory.OST_Sheets), ElementId.InvalidElementId);

 

 

But I get this error:

 

"categoryId is not a valid category for a regular schedule.

Parameter name: categoryIdA transaction or sub-transaction was opened but not closed. All changes to the active document made by External Command will be discarded."

 

So how do I go aobut creating a new Sheet List?

 

thx,

Barry

0 Likes
Reply
Accepted solutions (2)
1,494 Views
10 Replies
Replies (10)

b_ralphs
Advocate
Advocate

Is this not possible?

 

0 Likes

Anonymous
Not applicable
Accepted solution

You need to use the ViewSchedule.CreateSheetList(document) method

0 Likes

b_ralphs
Advocate
Advocate

Great thx for the reply, I'll give it a try.

0 Likes

b_ralphs
Advocate
Advocate

Thx for the info, I now have a blank sheet list.

Now how would I go about adding the sheets to it?

0 Likes

b_ralphs
Advocate
Advocate

Oh I think I need to add the "Sheet Number" & "Sheet Name" fields...

0 Likes

b_ralphs
Advocate
Advocate

OK I got the fields added with:

 

private static BuiltInParameter[] s_parametersNotToSkip = new BuiltInParameter[] { BuiltInParameter.SHEET_NAME, BuiltInParameter.SHEET_NUMBER };

 

 

private bool ShouldSkip(ElementId parameterId)
{
foreach (BuiltInParameter bip in s_parametersNotToSkip)
{
if (new ElementId(bip) == parameterId)
return false;
}
return true;
}

 

 

Now how do I add a new row to the schedule?

I think I need to use:

 

schedule.Definition.InsertField()

But I'm not sure what parameters to use....?

0 Likes

Anonymous
Not applicable

You won't actually add rows to the schedule.  When you add sheets to the model, they will appear in the sheet list. 

If they aren't appearing in the sheet list, make sure that you don't have any filters that may be hiding them.

0 Likes

b_ralphs
Advocate
Advocate

Thx for the reply.

Yes when I add new sheets the project they do show up in the schedule, but I want to add dummy/placeholder sheets. When you're in the schedule view in Revit it has the option to add these sheets as a new row on the Ribbon....

0 Likes

Anonymous
Not applicable
Accepted solution
You should be able to use the ViewSheet.CreatePlaceholder to accomplish that
0 Likes

b_ralphs
Advocate
Advocate

Cool, works great.

Thx for the help.

0 Likes