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

Results 1 to 9 of 9
Like Tree4Likes
  • 1 Post By Bjorn_K
  • 2 Post By Bjorn_K
  • 1 Post By chris.macko

Thread: Get view template

  1. #1
    Senior Member chris.macko's Avatar
    Join Date
    April 12, 2011
    Location
    Chicago, IL
    Posts
    523
    Current Local Time
    12:19 PM

    Get view template

    This seems like it should be an easy one. I'm trying to get the view templates of a list of views and the ootb View.ViewTemplate node comes back with a warning that just says operation failed. I also tried the clockwork node with the same name and it doesn't give me a warning, but it just outputs a null value. Am I missing something here or do these just not work?

  2. #2
    Moderator cellophane's Avatar
    Join Date
    August 9, 2011
    Location
    Louisville, KY
    Posts
    6,143
    Current Local Time
    01:19 PM
    from memory (I'll check it in a bit):
    Collect your views -> View.IsViewTemplate->FilterListByBoolMask

    A couple options in the attached image.
    Attached Thumbnails Attached Thumbnails Get view template-viewtemplates.png  
    Last edited by cellophane; March 7th, 2018 at 01:57 PM.

  3. #3
    Senior Member chris.macko's Avatar
    Join Date
    April 12, 2011
    Location
    Chicago, IL
    Posts
    523
    Current Local Time
    12:19 PM
    I was trying some of the same nodes and getting warnings.. but looks like the clockwork one is finally working, but I've got 2 other nodes that are throwing warnings and I'm not sure why. The first one just says operation failed even though it looks successful. The second one says converting from an array to a var is not allowed. Like I said it still gives me the right end product, but I'd like it to run clean if possible.
    Get view template-view-templates.png

  4. #4
    Moderator cellophane's Avatar
    Join Date
    August 9, 2011
    Location
    Louisville, KY
    Posts
    6,143
    Current Local Time
    01:19 PM
    There are a couple nodes in other packages than can clean the nulls out.

    I've run into a few instances where the node has a warning but still works - not sure why or how to resolve it though
    Attached Thumbnails Attached Thumbnails Get view template-nulls.png  

  5. #5
    Member Bjorn_K's Avatar
    Join Date
    April 8, 2011
    Location
    Rotterdam, Netherlands
    Posts
    320
    Current Local Time
    07:19 PM
    Looks like when collecting all the views the list has a little more in there than just the Views and View Templates (I've forgotten what it all was again, but it seems stuff like Legends are "weird" views as well). But probably if you check the list coming out from view.isviewtemplate you will find a few null values in between the false/true values.

    The Clockwork Node also tells you in the description that it will works for all View Types, but that does mean it only reports the element is not a VT, not that the element is actually a view or not.

    So by filtering on the T/F list from the IsViewTemplate+ Node you also let the non-view, non-view template elements through further in you script, which is the reason of the error messages later.
    Get view template-2018-03-07_1700.png

    I've solved this in the past by removing from the views collected all the items on the indexes that are reporting Null.

    Get view template-2018-03-07_1710.png

    Run this list through a BoolMask with the IsViewTemplate+ Node and you should end up with a list of real Views which you can query for Sheet Number etc.

    To tack on a question, anybody got a list of non-view "things" that we are collecting within the Views Category?
    chris.macko likes this.

  6. #6
    Member Bjorn_K's Avatar
    Join Date
    April 8, 2011
    Location
    Rotterdam, Netherlands
    Posts
    320
    Current Local Time
    07:19 PM
    @cellophane, the warning pops up because 1 (or more) of the elements in the list you are feeding the node is something not compatible with the function of the Node. Dynamo that does not just kill the function, but it will fail on that 1 element and throw a warning. It does still continue work on the other items in the list though.

    usually when you start exploring the lists of results you will find empty indices where the Node failed.

    For Instance: feed a list of numbers (containg a 0 value) into a Sphere.ByRadius Node. It will still make all the other sphere's, but it will fail on the one with 0mm radius.
    cellophane and chris.macko like this.

  7. #7
    Senior Member chris.macko's Avatar
    Join Date
    April 12, 2011
    Location
    Chicago, IL
    Posts
    523
    Current Local Time
    12:19 PM
    In this case I actually want to see the nulls since I'm trying to generate a list of views that don't have a view template applied, so just stripping them out won't work. Yeah, it still seems to be working, so I'm not sure how much I should be worrying about it. I've got some other graphs that don't throw warnings, but randomly don't work when they've been working in the past.

  8. #8
    Member Bjorn_K's Avatar
    Join Date
    April 8, 2011
    Location
    Rotterdam, Netherlands
    Posts
    320
    Current Local Time
    07:19 PM
    We're talking about different Nulls.

    I'm talking about the collection from the Views Category Node. In that list is some stuff that is not a View (like VTs). If you feed that later in Nodes that ask: Do you have a View Template applied? you get no answer (causing the yellow Nodes) because it is not something that can have a VT applied.

    So by getting rid of those non view, non VT elements as early as possible you are eliminating a ton of potential warnings.

  9. #9
    Senior Member chris.macko's Avatar
    Join Date
    April 12, 2011
    Location
    Chicago, IL
    Posts
    523
    Current Local Time
    12:19 PM
    Got it, thanks. I didn't see your post until after I replied so the nulls I was talking about was from Cellophane's comments on cleaning the lists. I see what you're talking about now and that makes a lot more sense. I was able to filter the legend views out and get it all working cleanly. I used the list.is empty node at the end to filter the views and that seems to be working much better.
    cellophane likes this.

Similar Threads

  1. View Template Negates Default View Detail Level
    By evan.dodds in forum Architecture and General Revit Questions
    Replies: 1
    Last Post: March 11th, 2016, 08:09 AM
  2. View's detail level deos not match view template setting
    By safoulkes in forum Architecture and General Revit Questions
    Replies: 7
    Last Post: June 11th, 2014, 09:41 PM
  3. 2014: *temporary* use of a view template can move your View in the browser
    By Duncan in forum Architecture and General Revit Questions
    Replies: 6
    Last Post: December 11th, 2013, 10:12 PM
  4. Replies: 0
    Last Post: March 7th, 2013, 07:15 AM
  5. Replies: 0
    Last Post: July 31st, 2012, 06:15 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
  •