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的安装目 ...
随机推荐
- Rabbitmq 3.6.5以上版本修改端口号方法
Rabbitmq 3.6.5以上版本修改端口号方法,网上查了下有一些方不管用,所以自己实践了引用官网说明 https://www.rabbitmq.com/configure.html#configu ...
- system分区解锁
前言 获取root权限,解锁system 步骤 手机设置 设置--更多设置--开发者选项--USB调试给打开 电脑操作 打开cmd adb devices 执行命令 adb root &&am ...
- 【find】linux文件搜索命令find/locate
参考链接:https://mp.weixin.qq.com/s/y8LeZ0-9D56TWsD-ivPaHQ 一.按文件名称查找 按照文件名称查找是 find 最常见的用法,需要注意的是,搜索的文件名 ...
- 【Spring】Spring中Bean的生命周期
Spring中Bean的生命周期依赖于Spring的容器,大致可分为以下4个阶段: 1.Bean的初始化阶段 2.Bean属性赋值的阶段,获取上下文关联 3.Bean初始化的阶段 4.Bean销毁的阶 ...
- CVE-2011-0104:Microsoft Office Excel 栈溢出漏洞修复分析
0x01 前言 上一篇讲到了 CVE-2011-0104 漏洞的成因和分析的方法,并没有对修复后的程序做分析.之后在一次偶然的情况下,想看一看是怎么修复的,结果却发现了一些问题 环境:修复后的 EXC ...
- Win64 驱动内核编程-2.基本框架(安装.通讯.HelloWorld)
驱动安装,通讯,Hello World 开发驱动的简单流程是这样,开发驱动安装程序,开发驱动程序,然后安装程序(或者其他程序)通过通讯给驱动传命令,驱动接到之后进行解析并且执行,然后把执行结果返回. ...
- Linux-鸟菜-0-计算机概论
Linux-鸟菜-0-计算机概论 这一章在说计算机概论,额....,总的来说看完之后还是有点收获,回忆了下计算机基本知识.没有什么可上手操作的东西,全是概念,直接把最后的总结给截图过来吧,因为概念的话 ...
- 板载网卡MAC地址丢失后刷回方法[转]
部份客户在进行误操作后发现网卡MAC地址全部变成0,大部客户不知道如何重新将MAC地址写回去.就此问题我们介绍一下,希望可以帮到大家.修改MAC地址时,一定要在纯DOS环境下修改.目前使用U盘DOS引 ...
- [源码解析] 并行分布式框架 Celery 之 Lamport 逻辑时钟 & Mingle
[源码解析] 并行分布式框架 Celery 之 Lamport 逻辑时钟 & Mingle 目录 [源码解析] 并行分布式框架 Celery 之 Lamport 逻辑时钟 & Ming ...
- eth-trunk
------------恢复内容开始------------ 1.eth-trunk 是什么 *链路 聚合技术 2.做什么用的 *作为一种链路捆绑技术,可以把多个独立物理接口绑定在一起,作为一个大带宽 ...