-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path00_Template_ImportLibary_Winform.py
More file actions
170 lines (143 loc) · 5.14 KB
/
00_Template_ImportLibary_Winform.py
File metadata and controls
170 lines (143 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import clr
import System
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import*
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import Selection
from Autodesk.Revit.UI.Selection import ISelectionFilter
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
#########################################################################
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
# clr.AddReference('System.Windows.Forms.DataVisualization')
import System.Windows.Forms
import System.Drawing
from System.Drawing import *
from System.Windows.Forms import *
from System.Collections.Generic import *
#########################################################################
doc = DocumentManager.Instance.CurrentDBDocument
View = doc.ActiveView
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
#########################################################################
# self._cbbFil.Items.AddRange(System.Array[System.Object](filStatus))
# self._cbbx.Items.AddRange(System.Array[System.Object](["a", "b", "c", "d"]))
#################################Link_Click########################################
class MainForm(Form):
def __init__(self):
self.InitializeComponent()
def InitializeComponent(self):
self._label1 = System.Windows.Forms.Label()
self._linkLabel1 = System.Windows.Forms.LinkLabel()
self.SuspendLayout()
#
# label1
#
self._label1.Location = System.Drawing.Point(12, 9)
self._label1.Name = "label1"
self._label1.Size = System.Drawing.Size(339, 23)
self._label1.TabIndex = 0
self._label1.Text = "https://www.youtube.com/channel/UCt2JhCDDFxpYho575WTMZ4g"
self._label1.Click += self.Link_Click
#
# linkLabel1
#
self._linkLabel1.Location = System.Drawing.Point(13, 36)
self._linkLabel1.Name = "linkLabel1"
self._linkLabel1.Size = System.Drawing.Size(338, 23)
self._linkLabel1.TabIndex = 1
self._linkLabel1.TabStop = True
self._linkLabel1.Text = "https://www.facebook.com/groups/864660200378936"
self._linkLabel1.LinkClicked += self.LinkLabel1LinkClicked
#
# MainForm
#
self.ClientSize = System.Drawing.Size(666, 316)
self.Controls.Add(self._linkLabel1)
self.Controls.Add(self._label1)
self.Name = "MainForm"
self.Text = "bb"
self.ResumeLayout(False)
def Link_Click(self, sender, e):
System.Diagnostics.Process.Start(self._label1.Text)
pass
def LinkLabel1LinkClicked(self, sender, e):
System.Diagnostics.Process.Start(self._linkLabel1.Text)
Application.Run(MainForm())
# CheckBox:
def ChbWFlCheckedChanged(self, sender, e):
self.Selected = []
if self._chbWFl.CheckedChanged != None:
self.Selected.append(IN[1])
self.Close()
pass
###############################HELLO WORLD#################################
import clr
import System
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import*
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI.Selection import*
from Autodesk.Revit.UI.Selection import ISelectionFilter
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
from Autodesk.Revit.DB import Line, ModelLine, LinePattern, ElementId
import Autodesk.Revit.DB as RDB
from Autodesk.Revit.DB import Line, GeometryInstance, Solid
#########################################################################
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
# clr.AddReference('System.Windows.Forms.DataVisualization')
import System.Windows.Forms
import System.Drawing
from System.Drawing import *
from System.Windows.Forms import *
from System.Collections.Generic import *
#########################################################################
doc = DocumentManager.Instance.CurrentDBDocument
View = doc.ActiveView
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
#########################################################################
class MainForm(Form):
def __init__(self):
self.InitializeComponent()
def InitializeComponent(self):
self._label1 = System.Windows.Forms.Label()
self.SuspendLayout()
#
# label1
#
self._label1.Location = System.Drawing.Point(191, 172)
self._label1.Name = "label1"
self._label1.Size = System.Drawing.Size(100, 23)
self._label1.TabIndex = 0
self._label1.Text = "HELLO WORLD"
self._label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
#
# MainForm
#
self.ClientSize = System.Drawing.Size(533, 397)
self.Controls.Add(self._label1)
self.Name = "MainForm"
self.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
self.Text = "Form1"
self.TopMost = True
self.ResumeLayout(False)
Application.Run(MainForm())