Migrating to 7.1 issue: ViewType


#1

Hi,

In 6.3 the below code allowed me to determine if the active view is a floor plan:

v = IN0
if v.ViewType == ViewType.FloorPlan:

…I’m just starting to migrate to 7.1 and this is my 1st hurdle. Cannot seem to access ViewType. My code is below. Any help is appreciated:

Python

 

 

 

 

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

Import RevitAPI

clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *

Import DocumentManager and TransactionManager

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

Import ToDSType(bool) extension method

clr.AddReference(“RevitNodes”)

import Revit
clr.ImportExtensions(Revit.Elements)
doc = DocumentManager.Instance.CurrentDBDocument

v = IN[0]
if v.ViewType == ViewType.FloorPlan:
OUT = 'yes’
else:
OUT = ‘no’


#2

…after running the same code today, I now get the error, “Could not add reference to assembly RevitServices”. Has anyone seen this before? I am using the recommended version of 7.1 not the latest build.

Thanks,

Dan