找回密码
 注册
搜索
查看: 16461|回复: 5

[在线求助] addsweep2问题

[复制链接]
发表于 2015-6-18 14:21:35 | 显示全部楼层 |阅读模式
YKLXY[I)6B[]9Q@~S`42CDG.png
求教如图所示,为什么会有如此的提示错误?
“Message: iteration over non-sequence of type Guid”
看了下帮助文件,AddCircle返回的数据类型为Guid,而Addsweep2需要的轨道的数据类型也为Guid。


发表于 2015-6-18 18:32:25 | 显示全部楼层
上传代码
回复

使用道具 举报

 楼主| 发表于 2015-6-19 09:13:33 | 显示全部楼层
不好意思~
代码如下:

import rhinoscriptsyntax as rs

def ZhuTou(Radius):
    Factor = 1.1
    Circle1 = rs.AddCircle ([0,0,0],Radius)
    Circle2 = rs.AddCircle ([0,0,-Radius * (Factor - 1)],Radius * Factor)
    Arc = rs.AddArc (rs.PlaneFromFrame ([Radius,0,- Radius *(Factor - 1)],[1,0,0],[0,0,1]),Radius * (Factor -1),90)
    Srf1 = rs.AddSweep2 ([Circle1,Circle2],Arc)
   
if __name__ == "__main__":
    ZhuTou(625)

点评

这种第二个参数需要的类型也是list,shapes Required. List. A list of Guids or strings identifying one or more shape, or cross section, curves. 所以改下就ok了。  详情 回复 发表于 2015-6-19 12:21回复
回复

使用道具 举报

发表于 2015-6-19 12:21:37 | 显示全部楼层

这种第二个参数需要的类型也是list,shapes    Required.  List.  A list of Guids or strings identifying one or more shape, or cross section, curves.

所以改下就ok了。
  1. import rhinoscriptsyntax as rs

  2. def ZhuTou(Radius):
  3.     Factor = 1.1
  4.     Circle1 = rs.AddCircle ([0,0,0],Radius)
  5.     Circle2 = rs.AddCircle ([0,0,-Radius * (Factor - 1)],Radius * Factor)
  6.     Arc = rs.AddArc (rs.PlaneFromFrame ([Radius,0,- Radius *(Factor - 1)],[1,0,0],[0,0,1]),Radius * (Factor -1),90)
  7.     Srf1 = rs.AddSweep2([Circle1,Circle2],[Arc])


  8. if __name__ == "__main__":
  9.     ZhuTou(625)
复制代码




1.png
回复

使用道具 举报

 楼主| 发表于 2015-6-23 16:24:12 | 显示全部楼层
月之眼 发表于 2015-6-19 12:21
这种第二个参数需要的类型也是list,shapes    Required.  List.  A list of Guids or strings identifyi ...

多谢月神!
写代码的时候老是会出现数据类型匹配错误,要多仔细了。

点评

恩呢,。仔细点就好了。。。  详情 回复 发表于 2015-6-23 16:46回复
回复

使用道具 举报

发表于 2015-6-23 16:46:36 | 显示全部楼层
Studyhardagain 发表于 2015-6-23 16:24
多谢月神!
写代码的时候老是会出现数据类型匹配错误,要多仔细了。

恩呢,。仔细点就好了。。。
回复

使用道具 举报

NCFZ微信公众号

手机版|小黑屋|NCF参数化建筑论坛 ( 浙ICP备2020044100号-2 ) 辽公网安备21021102000973号

GMT+8, 2026-11-23 21:36 , Processed in 0.056091 second(s), 29 queries , Gzip On.

Powered by Discuz! X5.0 Licensed

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表