需求:通过 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 ”的避免方法的更多相关文章

  1. sql查询语句报错处理——ERROR: failed to find conversion function from unknown to text

    今天遇到写存储过程遇到的一个小问题,在查询语句中使用到了自定义的数当做列的值,然后想给这一列起一个别名 ,就直接在后面用了 as 别名.执行存储过程,存储过程报错,ERROR: failed to f ...

  2. 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.引用出 ...

  3. flask+sqlite3+echarts2+ajax数据可视化报错:UnicodeDecodeError: 'utf8' codec can't decode byte解决方法

    flask+sqlite3+echarts2+ajax数据可视化报错: UnicodeDecodeError: 'utf8' codec can't decode byte 解决方法: 将 py文件和 ...

  4. 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内存的阿里云服务器 ...

  5. cordova编译报错:Execution failed for task ':processDebugResources'

    cordova编译报错:Execution failed for task ':processDebugResources' 引发这个错误的最扩祸首就是一个中文命名的文件,不知道什么时候加入的,我写了 ...

  6. 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 ...

  7. 第一次安装tomcat报错,出现failed to install tomcat8 service错误

    第一次安装tomcat报错,出现failed to install tomcat8 service错误(0) 一.一般情况下这种错误都是没有卸载干净造成的,安全卸载Tomcat的方法 (转载); ht ...

  8. centos6.5报错:checking filesystems failed问题处理

    centos系统重启报错:checking filesystems failed checking filesystems /dev/mapper/vg_0-root: 搜了下可能是文件系统损坏 根据 ...

  9. 【pycharm】pycharm上安装tensorflow,报错:AttributeError: module 'pip' has no attribute 'main' 解决方法

    pycharm上安装tensorflow,报错:AttributeError: module 'pip' has no attribute 'main' 解决方法 解决方法: 在pycharm的安装目 ...

随机推荐

  1. [重要更新]微信小程序登录、用户信息相关接口调整:使用 wx.getUserProfile 取代 wx.getUserInfo

    2021年2月24日,微信官方团队发布了一个调整通知:<小程序登录.用户信息相关接口调整说明>,公告明确从4月13日起,所有发布的小程序将无法使用 wx.getUserInfo 接口(JS ...

  2. PAT 乙级 -- 1001 -- 害死人不偿命的(3n+1)猜想

    题目: 卡拉兹(Callatz)猜想: 对任何一个自然数n,如果它是偶数,那么把它砍掉一半:如果它是奇数,那么把(3n+1)砍掉一半.这样一直反复砍下去,最后一定在某一步得到n=1.卡拉兹在1950年 ...

  3. Aircrack-ng破解无线WIFI密码

    首先,如果kali是装在虚拟机里面的话,是不能用物理机的无线网卡的.所以,如果我们要想进行无线破解,需要外接一个无线网卡设备,并且该设备要支持 monitor 监听模式 iwconfig :系统配置无 ...

  4. 子域名查询、DNS记录查询

    目录 子域名信息查询 Layer子域名爆破机 subDomainBrute 利用google查询 HTTP证书查询 DNS记录查询脚本 IP转换为经纬度 利用网页获取对方经纬度信息 首先关于DNS域名 ...

  5. 不安全的HTTP方法

    我们常见的HTTP请求方法是GET.POST和HEAD.但是,其实除了这两个之外,HTTP还有一些其他的请求方法. WebDAV (Web-based Distributed Authoring an ...

  6. C#-获取CPUID

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...

  7. visual studio 将他人的 vtk 程序在本机生成

    在网上下载了一些关于vtk的资源,在本机使用visual studio 打开后,生成时出现类似与以下的错误 无法打开包括文件:"vtkStructuredPointsToPolyDataFi ...

  8. 冒泡排序——Python实现

    冒泡排序Python实现 # -*- coding: utf-8 -*- # @Time : 2019/10/28 19:41 # @Author : yuzhou_1shu # @Email : y ...

  9. 使用docker-compose.yml快速搭建Linux/Mac开发/生产环境

    传送门 点击进入Github,https://github.com/ovim/dockerfiles 简单介绍 Dockerfiles 搭建基础公用环境包,方便使用,支持业务不断的提升而需要一些软件的 ...

  10. 逆向工程初步160个crackme-------4

    crackme–3因为涉及到浮点数操作以及一些指令和寄存器(由于本人对浮点指令不了解),所以先隔过去分析后面的程序. 工具:1. 按钮事件地址转换工具E2A 2. PEID 3. Ollydbg 首先 ...