明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1711|回复: 3

[选集] 根据范围选择对象

[复制链接]
发表于 2011-8-17 10:08 | 显示全部楼层 |阅读模式
各位大侠:我知道思路就是不会写,请帮帮忙啊。
思路:1,获取Polyline对象;2,获取Polyline线上的每个节点;3,根据获得的节点坐标设置选择集范围
 楼主| 发表于 2011-8-17 10:09 | 显示全部楼层
小弟,真的急用。这里还有个问题就是给多段线赋高程值。
发表于 2011-8-17 11:57 | 显示全部楼层
  1.     <CommandMethod("qjxz")> _
  2.     Public Sub 圈交范围内选择()
  3.         Dim optEntity As New PromptEntityOptions("选择多段线:")
  4.         With optEntity
  5.             .AllowNone = True
  6.             .AllowObjectOnLockedLayer = False
  7.             .SetRejectMessage("所选对象不是多段线")
  8.             .AddAllowedClass(GetType(Polyline), True)
  9.         End With
  10.         Dim resEntity As PromptEntityResult = ed.GetEntity(optEntity)
  11.         If resEntity.Status <> PromptStatus.OK Then Return

  12.         Dim ent As Polyline = GetEntity(resEntity.ObjectId)

  13.         Dim Pts As New Point3dCollection
  14.         ent.GetStretchPoints(Pts)
  15.         If Pts.Count = 0 Then Return
  16.         Dim resSelect As PromptSelectionResult = ed.SelectCrossingPolygon(Pts)
  17.         ed.SetImpliedSelection(resSelect.Value.GetObjectIds)

  18.     End Sub
 楼主| 发表于 2011-8-17 14:29 | 显示全部楼层
ywlm 发表于 2011-8-17 11:57

这里没有写获取节点坐标吧?我是新手,没看懂
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-24 02:12 , Processed in 0.239761 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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