conn_client
ConnClient
dataclass
Bases: BaseConnClient
Source code in dimine_python_sdk\conn\conn_client.py
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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | |
close_file(file_id)
async
关闭文件
Source code in dimine_python_sdk\conn\conn_client.py
21 22 23 24 25 | |
create_feature(file_id, feature_name, feature_define)
async
添加要素
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_id
|
str
|
文件ID、文件名称 |
required |
feature_name
|
str
|
要素名称 |
required |
feature_define
|
List[Dict[str, str]]
|
属性定义列表, 每个元素包含: - name: 属性名称 - type: 属性类型 ("string", "float", "int", "long", "short") |
required |
Raises:
| Type | Description |
|---|---|
Exception
|
创建失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | |
create_file(file_path)
async
在 Dimine 中新建文件
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
新建文件的完整路径 |
required |
Raises:
| Type | Description |
|---|---|
Exception
|
创建失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
27 28 29 30 31 32 33 34 35 36 37 38 | |
create_geometry(geometries)
async
创建模型
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometries
|
List[GEOMETRY]
|
模型列表,每个模型包含以下字段: - file: 文件名称 - layer: 图层名称 - feature: 要素列名称 - entity_type: "point | line | polyline | shell" - geometry: 几何信息 (coordinates) - properties: 属性信息列表 - color: 颜色 [R, G, B] |
required |
Raises:
| Type | Description |
|---|---|
Exception
|
创建失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
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 | |
create_layer(file_id, name)
async
创建图层
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_id
|
str
|
文件ID或文件名称 |
required |
name
|
str
|
图层名称 |
required |
Returns:
| Type | Description |
|---|---|
LayerInfo
|
创建的图层信息 |
Raises:
| Type | Description |
|---|---|
Exception
|
创建失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
delete_feature(file, feature_name)
async
删除要素
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str
|
文件名称 |
required |
feature_name
|
str
|
要素名称 |
required |
Raises:
| Type | Description |
|---|---|
Exception
|
删除失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | |
delete_geometry(delete_items)
async
删除模型
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delete_items
|
List[Dict[str, str]]
|
删除项列表,每个项包含: - id: 模型ID (句柄ID) - file: 文件ID (从哪个文件删除模型) |
required |
Raises:
| Type | Description |
|---|---|
Exception
|
删除失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
delete_layer(file_id, layer_name)
async
删除图层
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_id
|
str
|
文件ID或文件名称 |
required |
layer_name
|
str
|
图层名称 |
required |
Raises:
| Type | Description |
|---|---|
Exception
|
删除失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | |
export_file(file_id, file_path, mkdir=True)
async
导出文件
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_id
|
str
|
文件ID或文件名称 |
required |
file_path
|
str | Path
|
导出目标路径 |
required |
mkdir
|
bool
|
是否自动创建目录 |
True
|
Raises: Exception: 导出失败时抛出异常
Source code in dimine_python_sdk\conn\conn_client.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
get_features(file_id)
async
获取要素
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_id
|
str
|
文件ID |
required |
Returns:
| Type | Description |
|---|---|
List[FeatureInfo]
|
要素信息列表 |
Raises:
| Type | Description |
|---|---|
Exception
|
获取失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
get_files()
async
获取文件对象树
Source code in dimine_python_sdk\conn\conn_client.py
14 15 16 17 18 19 | |
get_geometry(file_id, layer_id, entity_types=[], features=None)
async
获取模型
Source code in dimine_python_sdk\conn\conn_client.py
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 | |
get_layers(file_id)
async
获取图层
Source code in dimine_python_sdk\conn\conn_client.py
272 273 274 275 276 277 | |
get_selected(page_size=100, page_num=1)
async
获取当前选中的模型
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page_size
|
int
|
每页数量,默认 100 |
100
|
page_num
|
int
|
页码,从 1 开始,默认 1 |
1
|
Returns:
| Type | Description |
|---|---|
SelectedResult
|
当前选择对象查询结果,包含选中对象列表及分页信息 |
Raises:
| Type | Description |
|---|---|
Exception
|
获取失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | |
open_file(file_path)
async
打开文件
Source code in dimine_python_sdk\conn\conn_client.py
40 41 42 43 44 45 46 47 48 49 50 51 52 | |
update_feature(file_id, feature_name, feature_define)
async
更新要素
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_id
|
str
|
文件名称或文件ID |
required |
feature_name
|
str
|
要素名称 |
required |
feature_define
|
List[Dict[str, str]]
|
属性定义列表, 每个元素包含: - name: 属性名称 - type: 属性类型 ("string", "float", "int", "long", "short") |
required |
Raises:
| Type | Description |
|---|---|
Exception
|
更新失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | |
update_geometry(geometries)
async
更新模型
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometries
|
List[GEOMETRY]
|
模型列表,每个模型包含以下字段: - id: 模型ID (句柄ID) - layer: 图层名称 - entity_type: "point | line | polyline | shell" - geometry: 模型几何信息 (可选) - properties: 模型属性信息 (可选) - color: 颜色 [R, G, B] (可选) - feature: 模型关联要素列表 (可选) |
required |
Raises:
| Type | Description |
|---|---|
Exception
|
更新失败时抛出异常 |
Source code in dimine_python_sdk\conn\conn_client.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
update_or_create_geometry(geometries)
async
创建或更新多个模型, 如果指定了file_id和layer_id, 则将模型添加到指定的文件及图层中
Source code in dimine_python_sdk\conn\conn_client.py
238 239 240 241 242 243 244 245 | |