FilledRegion.OwnerViewId


#1

For some reason I am getting an error message in python that says: ‘FillRegion’ object has no attribute ‘OwnerViewId’.

The Revit API lists OwnerViewId as a property of FilledRegion class. Am I missing something?

My script is below (IN[0] is a list of filled regions)
image


#2

Hi Pierre,

Can you try UnwrapElement?

This is from Clockwork:

image


#3

What does UnwrapElements do?


#4

Thanks,
It worked!

What does UnwrapElements do? Do I have to have a specific package loaded? I am asking because I’m writing a script for the office and I need to indicate whether or not specific packages should be loaded.


#5

Please have a look here: https://github.com/DynamoDS/Dynamo/wiki/Python-0.6.3-to-0.7.x-Migration

Unwrap allows you to use the RevitAPI directly.


#6

Thanks!


#7

Hi Can anyone help?
My code is not returning an owner view.

import clr

Import RevitAPI Classes

clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
#the above can be changed to import just specific classes separated by a comma

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

clr.AddReference(‘RevitNodes’)
import Revit

Adds ToDSType (bool) extension method to wrapped elements

clr.ImportExtensions(Revit.Elements)
#adds ToProtoType, ToRevitType geometry conversion extension methods to objects
clr.ImportExtensions(Revit.GeometryConversion)

#import documentmanager and transaction manager
clr.AddReference(‘RevitServices’)
from RevitServices.Transactions import TransactionManager
from RevitServices.Persistence import DocumentManager

create varible for revit document

doc = DocumentManager.Instance.CurrentDBDocument
elements = UnwrapElement(IN[0])
onvw = []

code that modifies revit database goes here

for ele in elements:
onvw.append(ele.OwnerViewId)

OUT = onvw

FINDING LOST CAD - 13TH.dyn (6.8 KB)