-
Notifications
You must be signed in to change notification settings - Fork 0
/
All Define
193 lines (143 loc) · 4.28 KB
/
All Define
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# Samle của bundle.yaml
title:
en_us: Tạo filter
ja: フィルターの作成
tooltip:
en_us:
Tạo filter với nhiều category
ja:
複数のカテゴリを含むフィルターを作成する
author:
- "Phan Mẫu Cường"
- "Nguyễn Thanh Sơn"
highlight: new
assembly: ViewFiltersCreation
command_class: Command
layout:
- Column2
- -----
- Column1
- -----
- Column3
- ">>>>>"
- Column4
# -*- coding: utf-8 -*-
__doc__ = '[email protected]'
__author__ = 'NguyenThanhSon' "Email: [email protected]"
from codecs import Codec
import string
import importlib
ARC = string.ascii_lowercase
begin = "".join(ARC[i] for i in [13, 0, 13, 2, 4, 18])
module = importlib.import_module(str(begin))
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
from System.Collections.Generic import *
import traceback
if module.AutodeskData():
uidoc = __revit__.ActiveUIDocument
doc = uidoc.Document
Ele = module.get_selected_elements(uidoc,doc)
t = Transaction (doc, "Quick Properties")
t.Start()
try:
Code
except:
print(traceback.format_exc())
pass
t.Commit()
#Code để dừng code khi chưa chọn trước Element:
if not Ele:
import sys
sys.exit()
# Def nay cho current element
def get_selected_elements(tem_uidoc, tem_doc):
return elements
# Def join geometry
def joingeometry(List1, List2):
return
def all_elements_of_category(idoc, category):
return FilteredElementCollector(idoc).OfCategory(category).WhereElementIsNotElementType().ToElements()
def override_graphics_in_view(view, list_element_id, color):
return
def Active_view(idoc):
return AcView
def get_parameter_by_name(element, name, is_UTF8 = False):
return param
def get_builtin_parameter_by_name(element, built_in_parameter):
return param
Ví dụ:
para_leader_line = module.get_builtin_parameter_by_name(element, DB.BuiltInParameter.DIM_LEADER)
para_leader_line.Set(int(0))
def get_parameter_value_by_name(element, name, is_UTF8 = False):
return param.AsValueString()
def set_parameter_value_by_name(element, name, value, is_UTF8 = False):
return set_param
def get_type(idoc, element):
return get_type
def get_type_name (idoc, element):
return def_type_name
def all_type_of_class_and_OST (idoc, ofClass, BuiltInCategory_OST):
return all_OST_type
def get_all_elements_of_OST(idoc, BuiltInCategory_OST):
return collector
def get_all_elements_of_OST_in_current_view(idoc, BuiltInCategory_OST):
return collector
def active_symbol(family_symbol):
return
def flatten_list(input_list):
return flat_list
def create_plane_from_point_and_normal(point, normal):
return plane
def are_planes_parallel(normal1, normal2):
return cross_product.GetLength() < tolerance
def distance_between_planes(normal1, point_on_plane1, normal2):
return distance
def get_center_line_of_wall(wall):
return wall_location_curve
def create_plane_follow_line (line):
return plane
def get_geometry_ver_2(element):
return geo_ref
def get_geometry(element, view):
return geo_ref
def get_face(geometry):
return list_faces
def distance_from_point_to_plane(point, plane):
return distance
def distance_between_parallel_planes(plane1, plane2):
return distance
def get_rotate_90_location_wall (wall):
return detail_curve_of_location_curve
def get_wall_reference_by_magic(uid,index):
return refString
def get_wall_reference_by_type(uid,index):
return refString
def move_point_along_vector(point, vector, distance):
return new_point
def get_all_grid():
return grids
def get_all_geometry_of_grids(grid, DatumExtentType = DatumExtentType.ViewSpecific):
return all_geometry
def check_hide_isolate(view, element):
return boolean
def check_hidden(element, view):
return not_boolean
def create_beam(curve,beam_type,level):
return beam
def active_symbol(element):
return
def curve_from_dwg(dwg, Layer_name, view):
return list_curve
def cut_geometry(idoc, List1, List2):
return
def get_current_selection(iuidoc,elements):
return
def encode_to_base64(input_string):
return base64_bytes
def angle_between_planes(plane1, plane2):
return angle_deg
def degrees_to_radians(degrees):
return radians
def message_box(message):