Donate Now Goal amount for this year: 2500 USD, Received: 1627 USD (65%)

Results 1 to 4 of 4
Like Tree5Likes
  • 2 Post By cellersick
  • 3 Post By Mimi Azimar

Thread: How to check an output is an element

  1. #1
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    05:18 PM

    Question How to check an output is an element

    How to check whether a parameter value is an element where in C# we can use "if element is level". For example here parameter Top Constraint is either a Level or Unconnected. Example as attached. If it is a level, return the level name and if it is Unconnected, return empty string.The mission is how to get the same results without warning.
    Attached Thumbnails Attached Thumbnails How to check an output is an element-top-constraint.png  

  2. #2
    Forum Addict GMcDowellJr's Avatar
    Join Date
    December 21, 2010
    Location
    Phoenix, AZ
    Posts
    2,603
    Current Local Time
    10:18 AM
    Use a List.FilterByBoolMask

    Find something to compare the list with to get a series of True/False (True = Level, False = not Level), and use this as the Mask for the List.Filter

  3. #3
    Member
    Join Date
    March 21, 2013
    Location
    Phoenix, AZ
    Posts
    275
    Current Local Time
    10:18 AM
    In Dynamo, I've found things work better if you can organize lists to perform the same operation on the entire list. ex - use the List.FilterByBoolMask and perform separate operations on each of the output lists ("in" and "out"). If you need more control over iteration, you might want to look at Code Blocks (using DesignScript) or the Python Script node.

    It also looks like the Top Constraint parameter may not be the most straightforward parameter - if you pass the output from GetParameterValueByName to Object.Type, you can see that you'll either get a System.String or a Revit.Elements.Level object.

    If you require the original list in the original index order, it might look something like the image below.

    Attached Thumbnails Attached Thumbnails How to check an output is an element-function.png  
    amoursol and Mimi Azimar like this.

  4. #4
    Junior Member
    Join Date
    March 16, 2017
    Location
    Malaysia
    Posts
    16
    Current Local Time
    05:18 PM
    Thanks cellersick and GMcDowellJr, the Object.Type word give me idea how to solve this.
    Attached Thumbnails Attached Thumbnails How to check an output is an element-objecttype.png  

Similar Threads

  1. Would like to create a Wall Profile Output similar to AutoCAD Civil 3d
    By JMDesign in forum Structure - Family Creation
    Replies: 0
    Last Post: February 9th, 2017, 08:21 PM
  2. Revit output options and third party plug ins
    By archedite in forum Architecture and General Revit Questions
    Replies: 30
    Last Post: September 15th, 2016, 04:31 PM
  3. Alive in the Lab: PDF Magick for Paper Output
    By Alive in the Lab in forum Blog Feeds
    Replies: 0
    Last Post: September 25th, 2014, 11:45 AM
  4. 3d to 3d generic model output
    By redmonki in forum Architecture - Family Creation
    Replies: 0
    Last Post: August 29th, 2014, 08:54 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
  •