0

第一:我想知道定义“分隔符=空格”并激活“创建点云”选项的正确措辞是什么。我尝试了这个和其他的东西,但是当我运行脚本时这些点永远不会加载。当我正常导入它们时,它当然可以工作。

第二:当我使用 os.path 或 pathlib 方法获取完整路径时,仅在使用双反斜杠 ("C:\\Users\\admin\\...\\filename") 完全写入路径时才找到该文件运行脚本时,我在 rhino 中遇到了 Windows 错误。我尝试了所有我能想到的方法,但似乎没有其他方法。感谢您的帮助!

for filename in os.listdir(targets_path):
   delim = " _Delimiters=_Space "
   pc = "_CreatePointcloud=_Yes"
   settings = [delim, pc]
   if filename.lower().endswith(".xyz"):           
      fullpath=os.path.join(targets_path,filename).lower()
      rs.EnableRedraw(False)
      rs.Command("_-Import {0} {1} _Enter".format(fullpath, settings))
rs.EnableRedraw(True)

该脚本跟随另一个启动 rhino 并在 vscode 中启动。我得到了分数,但它们都在 0,0,0 的一个地方。

rhino 返回: 命令:_-RunPythonScript C:\Users\admin\Desktop\LSH\Programmierung\xyz_swisstopo_api\py_modules\import_xyz.py _-Import c:\users\admin\desktop\lsh\programmierung\xyz_swisstopo_api\import_files\swissalti3d_0 .5_xyz_chlv95_ln02_2680_1249.xyz _Delimiters=_Space 成功读取文件“c:\users\admin\desktop\lsh\programmierung\xyz_swisstopo_api\import_files\swissalti3d_0.5_xyz_chlv95_ln02_2680_1249.xyz”_CreatePointcloud=_是未知命令

4

0 回答 0