Results 1 to 3 of 3

Thread: I could use some help updating my 2010 code. Filters in 2011.

  1. #1
    I could stop if I wanted to scowsert's Avatar
    Join Date
    2006-08
    Location
    Olympia, WA
    Posts
    418
    Login to Give a bone
    0

    Default I could use some help updating my 2010 code. Filters in 2011.

    I've written this little app in 2010 and with the filter changes in 2011 I just haven't gotten around to updating it. Well now I am. This was written in VB. The last line is where I'm stuck. I want to select all the Drafting Views.


    Dim app As UIApplication = commandData.Application
    Dim doc As Document = app.ActiveUIDocument.Document

    Dim filterView As TypeFilter = app.Create.Filter.NewTypeFilter(GetType(ViewDrafting), True)

  2. #2
    100 Club
    Join Date
    2004-09
    Posts
    104
    Login to Give a bone
    0

    Default Re: I could use some help updating my 2010 code. Filters in 2011.

    I work in C# and this works in 2011:

    Code:
    Autodesk.Revit.DB.Document m_doc = m_app.ActiveUIDocument.Document;
    ElementClassFilter vfilter = new ElementClassFilter(typeof(ViewDrafting));
    FilteredElementCollector vcollector = new FilteredElementCollector(m_doc);
    IList<Element> views = vcollector.WherePasses(vfilter).ToElements();
    Here is my attempt to convert the code to VB:

    Code:
    Dim app As UIApplication = commandData.Application
    Dim doc As Document = app.ActiveUIDocument.Document
     
    Dim filterview As New ElementClassFilter(GetType(ViewDrafting))
    Dim vcollector As New FilteredElementCollector(doc)
    Dim views As IList(Of Element) = vcollector.WherePasses(filterview).ToElements()

  3. #3
    I could stop if I wanted to scowsert's Avatar
    Join Date
    2006-08
    Location
    Olympia, WA
    Posts
    418
    Login to Give a bone
    0

    Default Re: I could use some help updating my 2010 code. Filters in 2011.

    Thanks for the help.

Similar Threads

  1. Revit 2011 - Structural - View Filters?
    By saeborne in forum Revit Architecture - General
    Replies: 1
    Last Post: 2010-06-29, 09:08 PM
  2. (2010) Transferring filters in View Templates
    By snowyweston in forum Revit Architecture - General
    Replies: 1
    Last Post: 2010-02-22, 01:09 AM
  3. Updating ADT 2006 lisps to ACA 2010
    By aargumaniz in forum AutoLISP
    Replies: 3
    Last Post: 2009-05-19, 04:32 PM
  4. Updating VBa Code to .Net
    By tatchley in forum Dot Net API
    Replies: 6
    Last Post: 2007-05-25, 01:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •