简体   繁体   English

是否对LineCurve类型的非序列进行迭代?

[英]Iteration over non-sequence of type `LineCurve`?

With the following code I get the error message below which I was not able to resolve using the documentation . 通过以下代码,我收到以下错误消息,以下错误消息无法使用文档解决。

  • x is an integer xinteger
  • ln is a Line ln是一条Line
  • degrees is a float degreesfloat

Here is the code 这是代码

import rhinoscriptsyntax as rs
a = []
for i in range(0, x + 1):           
    nl = rs.RotateObject(ln, rs.CurveEndPoint(ln), degrees * i, (0,0,1), True)
    a.append(nl)

I get the following message error: 我收到以下消息错误:

Runtime error (TypeErrorException): iteration over non-sequence of type LineCurve` 运行时错误(TypeErrorException):对LineCurve类型的非序列进行迭代

Traceback: 追溯:

line 1076, in TransformObjects, "C:\Users\**\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py"
  line 947, in RotateObjects, "C:\Users\**\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py"
  line 924, in RotateObject, "C:\Users\**\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py"
  line 7, in script

类型提示示例

Bibhas is right here. Bibhas就在这里。 The RotateObject function only accepts a guid. RotateObject函数仅接受GUID。 If you change the type hint for the input then it will work as expected. 如果您更改输入的类型提示,则它将按预期工作。 输出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM