Skip to content

Instantly share code, notes, and snippets.

View MostafaElAyoubi's full-sized avatar
🎯
Focusing

Mostafa El Ayoubi MostafaElAyoubi

🎯
Focusing
  • Data Shapes | Orkestra
  • Paris
  • X @data_shapes
View GitHub Profile
#Copyright (c) mostafa el ayoubi , 2016
#Data-Shapes www.data-shapes.net , elayoubi.mostafa@gmail.com
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Drawing import Point
from System.Windows.Forms import Application, Button, Form, Label, TextBox, CheckBox, FolderBrowserDialog, OpenFileDialog, DialogResult
class MultiTextBoxForm(Form):
@MostafaElAyoubi
MostafaElAyoubi / UI.MultipleInputForm++
Last active January 31, 2017 16:12
code for customizable form creation with dynamo, Data-Shapes package
#Copyright (c) mostafa el ayoubi , 2016
#Data-Shapes www.data-shapes.net , elayoubi.mostafa@gmail.com
import clr
try:
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Drawing import Point , Size , Graphics, Bitmap, Image, Font, FontStyle, Icon, Color
from System.Windows.Forms import Application, Button, Form, Label, ColumnHeader, TextBox, CheckBox, FolderBrowserDialog, OpenFileDialog, DialogResult, ComboBox, FormBorderStyle, ListView, ListViewItem , SortOrder, Panel, ImageLayout, GroupBox
@MostafaElAyoubi
MostafaElAyoubi / UI.MultipleInputForm Updated
Last active January 4, 2017 14:23
UI.MultipleInputForm Updated
#Copyright (c) mostafa el ayoubi , 2016
#Data-Shapes www.data-shapes.net , elayoubi.mostafa@gmail.com
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Drawing import Point
from System.Windows.Forms import Application, Button, Form, Label, TextBox, CheckBox, FolderBrowserDialog, OpenFileDialog, DialogResult, ComboBox, FormBorderStyle
from System.Collections.Generic import *
@MostafaElAyoubi
MostafaElAyoubi / ModificationTracker - parametersnapshot
Last active December 31, 2016 19:10
parametersnapshot definition
#Copyright (c) mostafa el ayoubi , 2016
#Data-Shapes www.data-shapes.net , elayoubi.mostafa@gmail.com
#This code was inspired by Jeremy Tammik @Jeremytammik
def parametersnapshot(x):
parameters = x.Parameters
paramnames = [p.Definition.Name for p in parameters]
#Sorting is important because the parameters are queried in random order.
#We need to make sure the snapshots are ordered in the same way so we can compare them.
sortedindex = sorted(range(len(paramnames)), key = lambda k : paramnames[k])
@MostafaElAyoubi
MostafaElAyoubi / ModificationTracker - getvertices
Last active December 31, 2016 19:01
getvertices definition
#Copyright (c) mostafa el ayoubi , 2016
#Data-Shapes www.data-shapes.net , elayoubi.mostafa@gmail.com
#This code was inspired by Jeremy Tammik @Jeremytammik
def flatten(container):
for i in container:
if isinstance(i, (list,tuple)):
for j in flatten(i):
yield j
else:
@MostafaElAyoubi
MostafaElAyoubi / Bounce on link
Last active November 3, 2016 17:28
Bounce on link