This file contains 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 getstatus(view, import_instance): | |
hidden = [] | |
visible = [] | |
catSub = import_instance.Category.SubCategories | |
for cat_cad in catSub: | |
in_view = view.GetCategoryHidden(cat_cad.Id) | |
if in_view: | |
hidden.append(cat_cad.Id) | |
else: | |
visible.append(cat_cad.Id) |
This file contains 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) 20119- POUPIN.C | |
import clr | |
import re | |
clr.AddReference('ProtoGeometry') | |
from Autodesk.DesignScript.Geometry import * | |
clr.AddReference('RevitAPI') | |
import Autodesk | |
from Autodesk.Revit.DB import * | |
clr.AddReference('RevitServices') | |
import RevitServices |
This file contains 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 * | |
#import Revit API | |
clr.AddReference('RevitAPI') | |
import Autodesk | |
from Autodesk.Revit.DB import * | |
#import transactionManager and DocumentManager (RevitServices is specific to Dynamo) |
This file contains 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 os | |
import os.path as op | |
import olefile | |
import re | |
def getfileInfo(bfi): | |
msgbox = 'Version non trouvée' | |
file_info_read = bfi.read() | |
for codec , regex in [['utf_16_le', r"(\d{4})..Build"], ['utf_16_be', r"Format.+?(\d{4})"]]: | |
file_info = file_info_read.decode(codec, "ignore") |
This file contains 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 System | |
import sys | |
pf_path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) | |
sys.path.append('%s\IronPython 2.7\Lib' % pf_path) | |
from cStringIO import StringIO | |
sys.stdout = StringIO() | |
alphabet = [chr(i) for i in range(ord('a'),ord('z')+1)] | |
def funtest(): | |
global dict |
This file contains 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 sys | |
from . import music_importer | |
sys.meta_path.append(music_importer.MusicImporter) | |
# このモジュールでimport sysされているため、必ずsys.modulesにsysはある | |
sys.modules['sys'] = sys |
This file contains 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
lstvar = ["A","B","C","","","D","F","","G","","",""] | |
newlst =[] | |
for x in lstvar: | |
if x != "": | |
newlst.append(x) | |
else: | |
newlst.append(newlst[-1]) | |
print newlst |
This file contains 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
lstvar = ["A","B","C","","","D","F","","G","","",""] | |
newlst =[] | |
for x in lstvar: | |
if x != "": | |
newlst.append(x) | |
else: | |
newlst.append(newlst[-1]) | |
print newlst |
This file contains 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 re | |
varstr = "Python c) like pip to install" | |
regEx = r'(\w\)\s\w+)\s?' | |
#mid = re.search(regEx, varstr).group(1) | |
newlst = re.split(regEx, varstr) | |
print newlst |
This file contains 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
var = ['a','b','c','b','c', 'd', 'e', 'a','b', 'a','b','c'] | |
def splitChar(lst): | |
temp = [] | |
for idx, x in enumerate(lst): | |
try: | |
if ord(x) + 1 == ord(lst[idx + 1]): | |
temp.append(x) | |
else: | |
temp.append(x) |
OlderNewer