明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1749|回复: 1

选择集

[复制链接]
发表于 2010-1-16 19:32:00 | 显示全部楼层 |阅读模式

在VBA中,要将选中的一个实体,handle = "87"

Sub ls()
  ThisDrawing.SendCommand "CopyClip" & vbCr & "(handent " & Chr(34) & "87" & Chr(34) & ")" & vbCr
 
End Sub

请教LISP的各位大侠


handent 只能是一个实体,目标需求是将VBA中的选择集SSET在这个例子中,用什么函数代替handent

 楼主| 发表于 2010-1-16 19:56:00 | 显示全部楼层

在网上找了一下,是将N个handent连接起来.

如果是这样哪就太麻烦了.

Public Function axSset2lspEnts(ByVal sSet As AcadSelectionSet) As String
  Dim enthandle As String
  Dim strEnts As String
  Dim i As Integer
  If sSet.count = 0 Then Exit Function
  enthandle = sSet.Item(0).Handle
  strEnts = "(handent" & Chr(34) & enthandle & Chr(34) & ")"
  If sSet.count > 1 Then
     For i = 1 To sSet.count - 1
         enthandle = sSet.Item(i).Handle
         strEnts = strEnts & vbCr & "(handent" & Chr(34) & enthandle & Chr(34) & ")"
     Next i
  End If
  axSset2lspEnts = strEnts
End Function

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

本版积分规则

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

GMT+8, 2024-10-1 21:35 , Processed in 0.153662 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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