明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3067|回复: 2

三维多线段如何转化为二维多线段?如何编辑三维多线段。打断为何不能用??急问。谢

[复制链接]
发表于 2004-4-27 16:12:00 | 显示全部楼层 |阅读模式
三维多线段如何转化为二维多线段?如何编辑三维多线段。打断为何不能用??急问。谢谢。[br]三维多线段如何转化为二维多线段?如何编辑三维多线段。打断为何不能用??急问。谢谢。
发表于 2004-4-27 20:45:00 | 显示全部楼层
  1. Sub test3Dto2D()
  2. '创建选择集
  3. Dim selset As AcadSelectionSet
  4. Dim cor3 As Variant
  5. Dim n As Integer
  6. Dim a As Integer
  7. 'a = 0
  8. Set selset = ThisDrawing.SelectionSets.Add("sset")
  9. selset.Select acSelectionSetAll         '遍历选择集
  10. Dim entry As AcadObject
  11. Dim pl As AcadLWPolylineFor Each entry In selset
  12.      If entry.EntityName = "AcDb3dPolyline" Then
  13.                cor3 = entry.Coordinates
  14.                n = (UBound(cor3) + 1) * 2 / 3
  15.                Dim pt() As Double
  16.                ReDim pt(0 To n - 1) As Double                       For i = 0 To (n - 2) Step 2
  17.                                pt(i) = cor3(a)
  18.                                pt(i + 1) = cor3(a + 1)
  19.                                a = a + 3
  20.                        Next i
  21.                        
  22.                Set pl = ThisDrawing.ModelSpace.AddLightWeightPolyline(pt)
  23.                '继承特性
  24.                pl.Layer = entry.Layer
  25.                pl.color = entry.color
  26.                entry.Delete
  27.                a = 0
  28.        End If
  29. Next entryselset.Delete '避免下次重复End Sub
 楼主| 发表于 2004-4-27 21:16:00 | 显示全部楼层
版主就是版主。


运行后3d polyline转变为polyline.


谢谢~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-18 20:56 , Processed in 0.287504 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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