明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1815|回复: 2

求助方法AddPolyfaceMesh得用法?

[复制链接]
发表于 2006-2-13 22:06:00 | 显示全部楼层 |阅读模式

不明白后面点和面是怎么组合的?

发表于 2006-2-13 22:52:00 | 显示全部楼层
<RE class=Code>这是AutoCAD帮助中的例子:</PRE><RE class=Code>
  1. <PRE class=Code>Sub Example_AddPolyfaceMesh()
  2.    
  3.     Dim vertexList(0 To 17) As Double
  4.     'Data
  5.     vertexList(0) = 4: vertexList(1) = 7: vertexList(2) = 0
  6.     vertexList(3) = 5: vertexList(4) = 7: vertexList(5) = 0
  7.     vertexList(6) = 6: vertexList(7) = 7: vertexList(8) = 0
  8.     vertexList(9) = 4: vertexList(10) = 6: vertexList(11) = 0
  9.     vertexList(12) = 5: vertexList(13) = 6: vertexList(14) = 0
  10.     vertexList(15) = 6: vertexList(16) = 6: vertexList(17) = 1
  11.    
  12.     Dim FaceList(0 To 7) As Integer
  13.     FaceList(0) = 1
  14.     FaceList(1) = 2
  15.     FaceList(2) = 5
  16.     FaceList(3) = 4
  17.     FaceList(4) = 2
  18.     FaceList(5) = 3
  19.     FaceList(6) = 6
  20.     FaceList(7) = 5
  21.     Dim obj As AcadPolyfaceMesh
  22.     Set obj = ModelSpace.AddPolyfaceMesh(vertexList, FaceList)
  23.     obj.Update
  24.     ' Change the viewing direction of the viewport to
  25.     ' better see the polyface mesh
  26.     Dim NewDirection(0 To 2) As Double
  27.     NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
  28.     ThisDrawing.ActiveViewport.direction = NewDirection
  29.     ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
  30.     ZoomAll
  31. End Sub</PRE>
</PRE>
 楼主| 发表于 2006-2-14 08:27:00 | 显示全部楼层
谢谢帮忙,看懂了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-27 06:23 , Processed in 0.170115 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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