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(含Java全套资源)
当下想学习Java开发的人越来越多,对于很多零基础的人来说,没有相关的视频教程及相关的学习线路,学起来是一件很费劲的事情,还有很多人从网上及其它渠道购买视频,这些视频资料的价格对于刚毕业的大学生来说也 ...
- .NET 5/.NET Core使用EF Core 5连接MySQL数据库写入/读取数据示例教程
本文首发于<.NET 5/.NET Core使用EF Core 5(Entity Framework Core)连接MySQL数据库写入/读取数据示例教程> 前言 在.NET Core/. ...
- 1017. Convert to Base -2
Given a number N, return a string consisting of "0"s and "1"s that represents it ...
- hdu4848 DFS 暴搜+ 强剪枝
题意: 给你一个图,然后问你从1出发遍历所有的点的距离和是多少,这里的距离和是每一个点到1的距离的总和,不是选择一条遍历所有点的路径的总长度,时间限制是 8000ms. 思路: ...
- [转]自建CDN防御DDoS
自建CDN防御DDoS(1):知己知彼,建设持久防线 前言 本议题是我们在OWASP杭州区2013年岁末年初安全沙龙中进行分享的内容,在此我们对这个议题的整体内容进行了重新归纳梳理,形成了文字版. 在 ...
- 解决Android加固多进程ptrace反调试的思路整理
本文博客链接:http://blog.csdn.net/qq1084283172/article/details/53613481 一.Android多进程反调试的原理代码 当ptrace附加目标进程 ...
- XCTF-wtf.sh-150
wtf.sh-150 题目描述 没有描述 解题过程 打开之后是个论坛,有注册和登录功能点 抓包发现,登陆成功后会设置cookie <script>document.cookie = 'US ...
- Filter过滤器的基本使用方法
ProjectDescription Filter的使用 创建类实现javax.servlet.Filter. 重写方法: init(); //过滤器初始化 doFilter(); //过滤请求 1. ...
- idea中修改代码大小设置
修改代码大小 控制台字体大小
- 多种方法实现实现全排列 + sort调用标准函数库函数的简述
全排列:所有不同顺序的元素组组成的一个集合.这里使用使用递归实现全排列. 使用递归算算法呢,首先我们先找一下结束的条件:我们要对一组元素(这里使用数字举例)实现全排列,临界条件就是递归到只有一个元素的 ...