ksobon / archilab

this is archi-lab.net dynamo repo
74 stars 20 forks source link

Get ViewFamily Type #33

Closed mrainville1618 closed 5 years ago

mrainville1618 commented 6 years ago

Modified the Get Viewport Type node. This allowed me to obtain a list of ViewFamily Types and is useful for my process in initial project setup. I was unable to figure out the Pull Request as there only seemed to be the one Master branch.

Copyright(c) 2015, Konrad K Sobon

@arch_laboratory, http://archi-lab.net

Edited to get viewfamilytypes by @Mark0Rainville

import clr

Import Element wrapper extension methods

clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements)

Import DocumentManager and TransactionManager

clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import DocumentManager doc = DocumentManager.Instance.CurrentDBDocument

import sys pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib' sys.path.append(pyt_path)

Import RevitAPI

clr.AddReference("RevitAPI") import Autodesk from Autodesk.Revit.DB import *

The inputs to this node will be stored as a list in the IN variable.

dataEnteringNode = IN

try: errorReport = None

Revised this section to select the higher level elements of the class ViewFamilyType

viewfamilies = FilteredElementCollector(doc).OfClass(ViewFamilyType).ToElements()

except:

if error accurs anywhere in the process catch it

import traceback
errorReport = traceback.format_exc()

Assign your output to the OUT variable

if errorReport == None:

Changed OUTput to the viewfamilies variable

OUT = viewfamilies

else: OUT = errorReport

ksobon commented 5 years ago

@mrainville1618 I think your custom node functionality can be achieved using OOTB nodes like so:

image

I will not be implementing this code. Thanks!

mrainville1618 commented 5 years ago

Yes, I found that not too long after. Thanks for the follow up.

On Sun, May 5, 2019 at 10:02 AM Konrad Sobon notifications@github.com wrote:

@mrainville1618 https://github.com/mrainville1618 I think your custom node functionality can be achieved using OOTB nodes like so:

[image: image] https://user-images.githubusercontent.com/529781/57197500-fb34c480-6f35-11e9-94fe-0a952a71a197.png

I will not be implementing this code. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ksobon/archilab/issues/33#issuecomment-489444260, or mute the thread https://github.com/notifications/unsubscribe-auth/AE7AKRMGCIBKAPJ3SAET6RTPT4HJ5ANCNFSM4GQMOFCQ .