0% found this document useful (0 votes)
93 views1 page

Codigo Python

This Python script imports several Revit API modules and defines a function to select faces from the current Revit document. It picks face elements from the user selection, gets the geometry from each face, optionally transforms it based on the element type, tags it with the reference, and adds it to a list to be output.

Uploaded by

ozelwill5388
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views1 page

Codigo Python

This Python script imports several Revit API modules and defines a function to select faces from the current Revit document. It picks face elements from the user selection, gets the geometry from each face, optionally transforms it based on the element type, tags it with the reference, and adds it to a list to be output.

Uploaded by

ozelwill5388
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import 

clr

[Link]("RevitAPIUI")
from  [Link] import *

[Link]("RevitServices")
import RevitServices
from [Link] import DocumentManager
doc = [Link]
uidoc=[Link]

[Link]("RevitNodes")
import Revit
[Link]([Link])
[Link]([Link])

[Link]('RevitAPI')
from [Link] import *

def output1(x):
    if len(x) == 1: return x[0]
    else : return x

surfaces, gpoints = [], []


sel1 = [Link]
ot1 = [Link]
ref_list = [Link](ot1, "Pick Faces")
for ref in ref_list:
    el1 = [Link]([Link])
    sf0 = [Link](ref)
    if isinstance(el1, FamilyInstance):
        tf1 = [Link]().ToCoordinateSystem()
        sf1 = [Link](ref, tf1)
    else:
        sf1 = [Link](True)
    for i in sf1: [Link]("RevitFaceReference", ref)
    [Link](output1(sf1) )

OUT = output1(surfaces)

You might also like