Determine Project/Document Type

Determine Project/Document Type

Anonymous
Not applicable
635 Views
2 Replies
Message 1 of 3

Determine Project/Document Type

Anonymous
Not applicable

Hello

 

I have searched the blog The Building Coder to see if my question is already answered there but no luck.

 

I am trying to determine the type of Revit project that is currently open. When I say the type, I mean, either MEP, Architectural, Structural or Construction.

 

Do you know how I can determine this? I have found an class called ProjectInfo but there isn't anything in there pertaining to the project type. There is a property called Category but as usual the help documentation provides a superficial 1 sentence explaination of the property that doesn't clear things up nor provide examples of it potential values. I have also run a project and output the Category property using .ToString() but it just outputs the namespace path "Revit.DB.ProjectInfo.Category"

 

If anyone could provide advice on how to determine the current Revit projects type I would be very greatful 🙂

0 Likes
636 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

The way I do it (not saying that is the preferred way), is to check for the presence of a specific item within the databse that can only be included when using a specific template.

 

What I mean is: I am always checking if it is from an 'Electrical Template'. I know that a few distribution systems are already set in elec. templates that do not exist in others, so I check for that first (see attachments).

 

I assume you could know what exists soley in a structural template also, then whatever is left by deduction, has to be Architectural.

 

Then set your rules based on the results from that.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks for your reply 🙂 Will try this technique out.

0 Likes