This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Copyright(c) 2020, chuongho | |
| # @chuongmep, https://chuongmep.com/ | |
| import clr | |
| import sys | |
| sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib') | |
| clr.AddReference('RevitAPI') | |
| from Autodesk.Revit.DB import * | |
| import clr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def GetParameterValue(parameter): | |
| value= None | |
| if parameter.StorageType == StorageType.Double: | |
| value = parameter.AsDouble() | |
| elif parameter.StorageType == StorageType.Integer: | |
| if parameter.Definition.ParameterType == ParameterType.Integer: | |
| value = parameter.AsInteger() | |
| else: | |
| value = parameter.AsValueString() | |
| elif parameter.StorageType == StorageType.String: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import clr | |
| clr.AddReference('ProtoGeometry') | |
| from Autodesk.DesignScript.Geometry import Surface as DSSurf | |
| clr.AddReference('RevitAPI') | |
| from Autodesk.Revit.DB import* | |
| clr.AddReference('RevitNodes') | |
| import Revit | |
| clr.ImportExtensions(Revit.GeometryConversion) | |
| import sys | |
| pyt_path = r'C:\\Program Files (x86)\\IronPython 2.7\\Lib' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static List<Autodesk.DesignScript.Geometry.Surface> GetTop(Autodesk.DesignScript.Geometry.Geometry geometry) | |
| { | |
| List<Autodesk.DesignScript.Geometry.Surface> TopSurface = new List<Autodesk.DesignScript.Geometry.Surface>(); | |
| Autodesk.DesignScript.Geometry.Geometry[] geometries = geometry.Explode(); | |
| foreach (Autodesk.DesignScript.Geometry.Surface g in geometries) | |
| { | |
| double d = g.NormalAtParameter(0.5, 0.5).Z; | |
| if (d>0.1) | |
| { | |
| TopSurface.Add(g); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load the Python Standard and DesignScript Libraries | |
| import sys | |
| import clr | |
| clr.AddReference('ProtoGeometry') | |
| from Autodesk.DesignScript.Geometry import * | |
| clr.AddReference('acdbmgd') | |
| clr.AddReference('acmgd') | |
| clr.AddReference('accoremgd') | |
| clr.AddReference('AecBaseMgd') | |
| import Autodesk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import clr | |
| import math | |
| import sys | |
| pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib' | |
| sys.path.append(pyt_path) | |
| import System | |
| clr.AddReference("RevitServices") | |
| import RevitServices |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mylist = IN[0] | |
| i, seen, result = mylist, set(), [] | |
| for _index, item in enumerate(i): | |
| if item not in seen: | |
| seen.add(item) | |
| else: | |
| result.append(_index) | |
| OUT = result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Copyright(c) 2020, chuongho | |
| # @chuongmep, https://chuongmep.com/ | |
| data = IN[0] | |
| item = IN[1] | |
| newlst = [] | |
| i=0 | |
| for n in item: | |
| i = i+1 | |
| try: | |
| lst = data[data.index(n):data.index(item[i])] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Copyright(c)2020,chuongho | |
| #@chuongmep,https://chuongmep.com/ | |
| import clr | |
| clr.AddReference('ProtoGeometry') | |
| clr.AddReference('RevitAPI') | |
| clr.AddReference("RevitServices") | |
| from Autodesk.DesignScript.Geometry import * | |
| from Autodesk.Revit.DB import * | |
| from RevitServices.Persistence import DocumentManager | |
| from RevitServices.Transactions import TransactionManager |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| spfile = app.OpenSharedParameterFile() | |
| def defFile(spfile, group, param): | |
| defGroup = spfile.Groups.get_Item(group) | |
| return defGroup.Definitions.get_Item(param) |
OlderNewer