io
Native Layer v2 IO 模块
文件转换、DMF 读写、文本实体。 对外不暴露 C++ 对象。
FileFormat
Bases: StrEnum
支持的文件格式
Source code in dimine_python_sdk\lib\native\io.py
29 30 31 32 33 34 35 36 37 | |
NativeTextHandle
文本实体不透明句柄,内部持有 C++ dmDbText 对象
Source code in dimine_python_sdk\lib\native\io.py
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 | |
create()
classmethod
创建文本实体
Source code in dimine_python_sdk\lib\native\io.py
98 99 100 101 102 103 104 | |
set_normal()
自动计算法线方向
Source code in dimine_python_sdk\lib\native\io.py
178 179 180 | |
to_model()
转换为 NativeText 数据模型
Source code in dimine_python_sdk\lib\native\io.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
convert_file(source, target)
执行文件格式转换。
Raises:
| Type | Description |
|---|---|
NativeIOError
|
不支持的格式或转换失败 |
Source code in dimine_python_sdk\lib\native\io.py
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 | |
read_dmf(file_path)
读取 DMF 文件,返回要素定义列表和图层列表。
Returns:
| Type | Description |
|---|---|
tuple[list[NativeFeature], list[NativeLayer]]
|
(features, layers) |
Source code in dimine_python_sdk\lib\native\io.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
write_dmf(file_path, layers, features=None)
将 NativeLayer/NativeFeature 写入 DMF 文件。
会根据传入的 features 注册要素定义和属性字段,并将属性值写入每个
实体的属性记录。
Source code in dimine_python_sdk\lib\native\io.py
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 | |