明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1271|回复: 2

『请教』对象选择的代码修改

[复制链接]
发表于 2008-8-23 13:09:00 | 显示全部楼层 |阅读模式

Sub 选择并移动()
Dim SssObj As Object

Set SssObj = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1) '.
Dim point1(0 To 2) As Double
Dim point2(0 To 2) As Double
point1(0) = 0: point1(1) = 0: point1(2) = 0
point2(0) = 2: point2(1) = 0: point2(2) = 0
' 移动圆
SssObj.Move point1, point2
这段代码只能对一个独立的基本图形进行移动。我想移动这个图层的全部图形代码该怎么改

发表于 2008-8-23 21:43:00 | 显示全部楼层
一个对象一个对象移。
发表于 2008-8-24 22:21:00 | 显示全部楼层

Sub 选择并移动()
Dim SssObj As Object

Set SssObj = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1) '.
Dim point1(0 To 2) As Double
Dim point2(0 To 2) As Double
point1(0) = 0: point1(1) = 0: point1(2) = 0
point2(0) = 2: point2(1) = 0: point2(2) = 0

 dim entry as acadentry

for each entry in sssobj
entry.Move point1, point2

next

选择集内的对象要一个一个来操作

帮你写上来吧!

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

本版积分规则

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

GMT+8, 2024-11-26 06:42 , Processed in 0.166940 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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