grasshopper | 通过图层引用线条 报错:“ Data conversion failed from Guid to Curve ”的避免方法
需求:通过 LunchBox - > layer reference 电池 可以快速选中图层所在的线条,但是选择的数据流错误

直接选择会报错——“Data conversion failed from Guid to Curve”:

因为是通过图层电池会选择 instance 实例化的物体,物体的类型是多种的 ,所以需要剔除不符合所要的数据类型:

import rhinoscriptsyntax as rs
import Rhino.Geometry.InstanceReferenceGeometry # 遍历版本
curveLst = []
def judgeCurve(): for i, item in enumerate(x):
# print(item.GetType()) if item.GetType() == Rhino.Geometry.Curve or item.GetType() == Rhino.Geometry.ArcCurve \
or item.GetType() == Rhino.Geometry.Arc \
or item.GetType() == Rhino.Geometry.PolyCurve \
or item.GetType() == Rhino.Geometry.Polyline \
or item.GetType() == Rhino.Geometry.PolylineCurve \
or item.GetType() == Rhino.Geometry.Line \
or item.GetType() == Rhino.Geometry.Circle \
or item.GetType() == Rhino.Geometry.Ellipse \
or item.GetType() == Rhino.Geometry.NurbsCurve \
or item.GetType() == Rhino.Geometry.BezierCurve \
or item.GetType() == Rhino.Geometry.LineCurve:
curveLst.append(item) judgeCurve()
a = curveLst

筛选出数据即可正常运行:

IGH_Goo 数据类型定义
https://developer.rhino3d.com/guides/grasshopper/grasshopper-data-types/
在 C# 中的用法:
GH_Structure<IGH_Goo> tree11 = new GH_Structure<IGH_Goo>();
对数据层级进行操作
Layer and Sublayer creation in C#
grasshopper | 通过图层引用线条 报错:“ Data conversion failed from Guid to Curve ”的避免方法的更多相关文章
- sql查询语句报错处理——ERROR: failed to find conversion function from unknown to text
今天遇到写存储过程遇到的一个小问题,在查询语句中使用到了自定义的数当做列的值,然后想给这一列起一个别名 ,就直接在后面用了 as 别名.执行存储过程,存储过程报错,ERROR: failed to f ...
- iOS 报错: linker command failed with exit code 1 (use -v to see invocation) 原因
在iOS开发中,很多人会遇到这样的报错 linker command failed with exit code 1 (use -v to see invocation) 可能的原因如下: 1.引用出 ...
- flask+sqlite3+echarts2+ajax数据可视化报错:UnicodeDecodeError: 'utf8' codec can't decode byte解决方法
flask+sqlite3+echarts2+ajax数据可视化报错: UnicodeDecodeError: 'utf8' codec can't decode byte 解决方法: 将 py文件和 ...
- quartz集群报错but has failed to stop it. This is very likely to create a memory leak.
quartz集群报错but has failed to stop it. This is very likely to create a memory leak. 在一台配置1核2G内存的阿里云服务器 ...
- cordova编译报错:Execution failed for task ':processDebugResources'
cordova编译报错:Execution failed for task ':processDebugResources' 引发这个错误的最扩祸首就是一个中文命名的文件,不知道什么时候加入的,我写了 ...
- Xamarin 示例Standard Controls报错:xamarin Failed to compile interface file. See Build Output for details
Standard Controls 示例下载地址: http://developer.xamarin.com/content/StandardControls/ Xamarin官网上的IOS示例“St ...
- 第一次安装tomcat报错,出现failed to install tomcat8 service错误
第一次安装tomcat报错,出现failed to install tomcat8 service错误(0) 一.一般情况下这种错误都是没有卸载干净造成的,安全卸载Tomcat的方法 (转载); ht ...
- centos6.5报错:checking filesystems failed问题处理
centos系统重启报错:checking filesystems failed checking filesystems /dev/mapper/vg_0-root: 搜了下可能是文件系统损坏 根据 ...
- 【pycharm】pycharm上安装tensorflow,报错:AttributeError: module 'pip' has no attribute 'main' 解决方法
pycharm上安装tensorflow,报错:AttributeError: module 'pip' has no attribute 'main' 解决方法 解决方法: 在pycharm的安装目 ...
随机推荐
- java 读取ini文件
1.情景:需要将硬代码写到文件中,这样以后改动只需改动灵活 1)txt文件,需要将这code字符串读到代码中,保存成数组 2)导包:pom.xml添加依赖: <dependency> &l ...
- MyBatisPlus入门学习
目录 MyBatisPlus 概述 快速入门 配置日志输出 CRUD拓展 插入 主键生成策略 更新操作 自动填充 乐观锁 查询操作 分页查询 删除操作 逻辑删除 性能分析插件 条件构造器 代码自动生成 ...
- 06- web兼容性测试与web兼容性测试工具
web兼容性概述 定义:软件兼容性测试是指检查软件之间能否正确地进行交互和共享信息.随着用户对来自各种类型软件之间共享数据能力和充分利用空间同时执行多个程序能力的要求,测试软件之间能否协作变得越来越重 ...
- 【beego】beego的路由设置
beego 存在三种方式的路由:固定路由.正则路由.自动路由 基础路由 从 beego 1.2 版本开始支持了基本的 RESTful 函数式路由,应用中的大多数路由都会定义在 routers/rout ...
- Flyway-数据库迁移工具
一.什么是Flyway? Flayway是一款数据库版本控制管理工具,支持数据库版本自动升级,Migrations可以写成sql脚本,也可以写在java代码里:不仅支持Command Line和jav ...
- Python脚本与Metasploit交互攻击
Metasploit是一款强大的漏洞扫描和利用工具,编写Python脚本与Metasploit进行交互,可以自动化的扫描和利用漏洞. 相关文章:Metasploit框架的使用 在脚本中,我们首选需要利 ...
- Win64 驱动内核编程-8.内核里的其他常用
内核里的其他常用 1.遍历链表.内核里有很多数据结构,但它们并不是孤立的,内核使用双向链表把它们像糖 葫芦一样给串了起来.所以遍历双向链表能获得很多重要的内核数据.举个简单的例子,驱 动对象 Driv ...
- CVE-2018-0798:Microsoft office 公式编辑器 Matrix record 字段栈溢出漏洞调试分析
\x01 前言 2018 年 1 月 9 日,Office 公式编辑器再曝出新漏洞,编号为 CVE-2018-0798.提起公式编辑器大家都不陌生,之前的 CVE-2017-11882 和 CVE-2 ...
- windows-DLL注入
DLL注入 刚刚整理的代码注入(远程线程注入)现在整理这个DLL注入,DLL注入比较常用,相比远程代码注入DLL注入没有什么太多的限制,而且实现起来比较简单,当然远程线程需要注意的问题DLL很 ...
- SSRF_FastCGI
SSRF_FastCGI 目录 SSRF_FastCGI FastCGI协议 SSRF ssrf + fastcgi 参考 FastCGI协议 简介 Fast CGI源自旧版本的CGI 路由/结构图 ...