Revision numbering is per sheet error

Revision numbering is per sheet error

markjvlampad
Advocate Advocate
618 Views
1 Reply
Message 1 of 2

Revision numbering is per sheet error

markjvlampad
Advocate
Advocate

I am having trouble with this code when Revision is set to per Sheet.

 

 foreach( ElementId elemID in oElemIDs )
                          {
                            Element oEl = doc.GetElement( elemID );
                             Revision rev = oEl as Revision;
                             
                             string x  =rev.Description+" "+ rev.RevisionDate+" "+rev.SequenceNumber.ToString() + " "+ rev.RevisionNumber.ToString();

                             TaskDialog.Show("Rev: ",  x);
                          }

 

 

can anyone help me? 

0 Likes
619 Views
1 Reply
Reply (1)
Message 2 of 2

TripleM-Dev.net
Advisor
Advisor

Hi,

 

If the Revisions are setup to number based on sheets and not for the whole project the RevisionNumber throws a error, as the documentation states, see: RevisionNumber Property 

 

First retrieve the RevisionSettings  and check if RevisionNumbering  = PerProject or PerSheet.

If the setting is PerProject  then the RevisionNumber can be retrieved.

 

If you need the revisio number if it's set by Sheet, get it from the sheet itself.

Use the builtinparameter: BuiltInParameter.SHEET_CURRENT_REVISION.

This will always report the Revision number of the sheet, doesn't matter if it's project or sheet based.

 

- Michel

0 Likes