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的安装目 ...
随机推荐
- Typora 修改代码块高亮样式
目录 方法一:下载自己喜欢的样式 方法二:获取Typora自制主题 方法三:自己撰写css样式文件 方法一:下载自己喜欢的样式 Typora的代码块语法高亮使用的是CodeMirror实现的,所以需要 ...
- 洛谷P1085 不高兴的津津
题目描述 津津上初中了.妈妈认为津津应该更加用功学习,所以津津除了上学之外,还要参加妈妈为她报名的各科复习班.另外每周妈妈还会送她去学习朗诵.舞蹈和钢琴.但是津津如果一天上课超过八个小时就会不高兴,而 ...
- 设计模式-UML图简单介绍
直接上法宝: 1.类(Class) 类图分三层: 第一层显示类的名称,如果是抽象类,则就用斜体显示. 第二层是类的特性,通常就是字段和属性. 第三层是类的操作,通常是方 ...
- poj2175费用流消圈算法
题意: 有n个建筑,每个建筑有ai个人,有m个避难所,每个避难所的容量是bi,ai到bi的费用是|x1-x2|+|y1-y2|+1,然后给你一个n*m的矩阵,表示当前方案,问当前避难方案是否 ...
- Python中hashlib模块的使用
hashlib是 python 下一款与加密相关的库包,提供摘要算法:md5.sha1.sha224.sha256.sha384.sha512.blake2b.blake2s.sha3_224.sha ...
- pycharm2019
812LFWMRSH-eyJsaWNlbnNlSWQiOiI4MTJMRldNUlNIIiwibGljZW5zZWVOYW1lIjoi5q2j54mIIOaOiOadgyIsImFzc2lnbmVlT ...
- pysmiles:一个用于读写SMILES表达式的python库
技术背景 SMILES表达式是化学里面常用的用于标定元素之间关系的字符串,旨在用最简短的语句来完整的表达一个分子体系内所蕴含的基本信息,比如元素.连接性以及连接属性等.由于SMILES表达式的定义种类 ...
- UIautomator2框架快速入门App自动化测试
01.APP测试框架比较 常见的APP测试框架 APP测试框架 02.UIAutomator2简介 简介 UIAutomator2是一个可以使用Python对Android设备进行UI自动化的库. ...
- Spring Cloud Alibaba(9)---Sentinel概述
Sentinel概述 随着微服务的流行,服务和服务之间的稳定性变得越来越重要.Sentinel是面向分布式服务架构的流量控制组件,主要以流量为切入点,从限流.流量整形.熔断降级.系统自适应保护.热点防 ...
- 使用C#操作注册表
这节讲一下使用C#操作注册表. 首先来了解一下,什么是注册表,注册表是Windows中特有的一个东西,百度百科中对其解释如下:Windows注册表(Registry)实质上是一个庞大的数据库,它存储着 ...