RevitCity.com Logo

Home  |  Forums  |  Downloads  |  Gallery  |  News & Articles  |  Resources  |  Jobs  |  FAQ  |  SearchSearch  |  Join  |  LoginLogin

Welcome !

65 Users Online (63 Members): Show Users Online - Most ever was 626 - Mon, Jan 12, 2015 at 2:00:17 PM

 

Forums

Forums >> Workflow & Implementation >> API & Third Party Apps >> ActiveDocument.Elements vs. ActiveDocument.ActiveView.Elements

Search this ThreadSearch this Thread | Page 1 of 1 |

Wed, Jul 15, 2009 at 1:42:16 PM | ActiveDocument.Elements vs. ActiveDocument.ActiveView.Elements

#1

rkitect


active
rkitect Avatar

Joined: Thu, Dec 16, 2004
792 Posts
4 Stars: 29 Votes


I'm trying to get an element set from the active view using a some code from th DevTV tutorials.  This works to grab an element set from the entire model:

ElementSet elems = revitApp.Create.NewElementSet();            ElementIterator iter = revitApp.ActiveDocument.Elements;            while (iter.MoveNext())

 

So I assumed that changing it to 

ElementSet elems = revitApp.Create.NewElementSet();            ElementIterator iter = revitApp.ActiveDocument.ActiveView.Elements;            while (iter.MoveNext())

 

Would allow me to work from the active view element set however, I'm getting the error: 

"Cannot implicitly convert type 'Autodesk.Revit.ElementSet' to 'Autodesk.Revit.ElementIterator'"

Any insight into why this happens and what the type difference between the Elements object in ActiveDocument is compared to ActiveView?

 

TIA,


-----------------------------------

-//------------------------

Carl - rkitecsure[at]gmail.com

Need help? I'm probably in my chat room!

You fell victim to one of the classic blunders. The most famous is never get involved in a land war in asia, but only slightly less well known is this! Never go in against a Sicilian when death is on the line!

This user is offline

View Website

Search this ThreadSearch this Thread | Page 1 of 1 |



Similar Threads

Thread/Thread Starter

Forum

Last Post

Replies

Replacing Structural Elements in Arch Model with Revit Structure elements

Revit Building >> Technical Support

Sun, Dec 4, 2011 at 4:06:34 AM

0

Cleaning Up Design Option Elements with Main Model Elements

Revit Building >> Technical Support

Wed, Jun 17, 2015 at 1:38:27 PM

4

Receiving "Can't keep elements joined" message when joining 3 family elements

Revit Building >> Technical Support

Tue, Apr 21, 2015 at 11:26:44 AM

1

Newbie - Need help with mass elements

Revit Building >> Technical Support

Mon, Feb 8, 2010 at 1:11:14 PM

1

How to work with the elements from link

Revit Building >> Technical Support

Tue, May 27, 2008 at 12:14:43 PM

6

Site Stats

Members:

1994011

Objects:

22882

Forum Posts:

152185

Job Listings:

3

Sponsored Ads

Home | Forums | Downloads | Gallery | News & Articles | Resources | Jobs | Search | Advertise | About RevitCity.com | Link To Us | Site Map | Member List | Firm List | Contact Us

Copyright 2003-2010 Pierced Media LC, a design company. All Rights Reserved.

Page generation time: 0.3899

Login

User Name:

Password:

Remember Me  

Forgot Password?

Search Forums

Advanced Search

Search Forums

Advanced Search


Clear Highlights


Clear Highlights