乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 155|回复: 9

求助

[复制链接]

27

主题

103

帖子

7

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2004-6-19 20:33:00 | 显示全部楼层 |阅读模式
怎样把一个整个图层中的图形MIRROR或MOVE
怎么把图形中倒数第N个图形MIRROR 或MOVE
回复

使用道具 举报

72

主题

2726

帖子

9

银币

社区元老

Rank: 75Rank: 75Rank: 75

铜币
3014
发表于 2004-6-19 20:42:00 | 显示全部楼层
Signature
object.Move Point1, Point2
Object
,
The object or objects this method applies to.
Point1
Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first point of the move vector.
Point2
Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second point of the move vector.
       
Signature
RetVal = object.Mirror(Point1, Point2)
Object
The object or objects this method applies to.
Point1
Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first point of the mirror axis.
Point2
Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second point of the mirror axis.
RetVal
Mirrored object
This object can be one of any .
回复

使用道具 举报

27

主题

103

帖子

7

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2004-6-19 20:56:00 | 显示全部楼层
这个我在帮助里看到过
我现在要做的是把倒数第32到最后一个图形,整体移动
或者说把一个图层中的所有图形
回复

使用道具 举报

72

主题

2726

帖子

9

银币

社区元老

Rank: 75Rank: 75Rank: 75

铜币
3014
发表于 2004-6-19 21:01:00 | 显示全部楼层
用For循环做呀
或SendCommand
参见
回复

使用道具 举报

27

主题

103

帖子

7

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2004-6-19 21:32:00 | 显示全部楼层
  1. Sub QSelLayerControl()
  2. '程序功能:快速选取一层的所有对象,进行相应的操作
  3.        Dim i   As AcadEntity
  4.        Dim ss As AcadSelectionSet
  5.        Dim ft(0) As Integer, fd(0)
  6.        Dim pLayer As String
  7.        Dim pControl As String
  8.        pLayer = ThisDrawing.Utility.GetString(0, vbCrlLf & "请输入层名:")
  9.        ft(0) = 8: fd(0) = pLayer
  10.        Set ss = ThisDrawing.ActiveSelectionSet
  11.        ss.Clear
  12.        ss.Select acSelectionSetAll, , , ft, fd
  13.        If ss.Count = 0 Then
  14.                ss.Delete
  15.                ThisDrawing.Utility.Prompt "层内没有对象或层不存在!"
  16.        Else
  17.                ThisDrawing.Utility.InitializeUserInput 1, "Move Copy Erase"
  18.                pControl = ThisDrawing.Utility.GetKeyword(vbCr & "请输入操作名[Move(移动)/Copy(复制)/Erase(删除)]:")
  19.                ThisDrawing.SendCommand "." & pControl & vbCr & "p" & vbCr & vbCr
  20.        End If
如果我不需要在CAD中选择等操作,直接在代码中实现.可以吗?
回复

使用道具 举报

72

主题

2726

帖子

9

银币

社区元老

Rank: 75Rank: 75Rank: 75

铜币
3014
发表于 2004-6-19 22:19:00 | 显示全部楼层
假设pObjs是你程序中获得的实体数组或集合或选择集复制代码
回复

使用道具 举报

27

主题

103

帖子

7

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2004-6-20 08:19:00 | 显示全部楼层
大哥:帮我写完整一点好吗?
先MIRROR后MOVE(层中的所有图形)
急用
回复

使用道具 举报

72

主题

2726

帖子

9

银币

社区元老

Rank: 75Rank: 75Rank: 75

铜币
3014
发表于 2004-6-20 10:10:00 | 显示全部楼层
Sub MMLayer(ByVal LayerName As String, ByVal p1, ByVal p2, ByVal p3, ByVal p4)
Dim i As AcadEntity
Dim ft(0) As Integer, fd(0)
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.SelectionSets.Add("*TlsTest*")
ft(0) = 8: fd(0) = LayerName
ss.Select acSelectionSetAll, , , ft, fd
For Each i In ss
i.Mirror(p1, p2).Move p3, p4
i.Delete
Next i
ErrHandle:
ss.Delete
End Sub
回复

使用道具 举报

27

主题

103

帖子

7

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2004-6-20 10:12:00 | 显示全部楼层
  1. Sub zhouhui1()
  2. Dim layerObj As AcadLayerSet layerObj = ThisDrawing.Layers.Add("ABC")  Dim x As AcadObject
  3. 'x.Color = acByLayer
  4. For Each x In ThisDrawing.ModelSpace
  5.      x.Layer = "ABC"
  6.      
  7. ' 指定“ABC”图层的颜色为红色     ' x.Color = acRed
  8.        x.Update
  9. Next xDim point1(0 To 2) As Double
  10.        Dim point2(0 To 2) As Double
  11.        point1(0) = 0: point1(1) = 0: point1(2) = 0
  12.        point2(0) = 2: point2(1) = 0: point2(2) = 0
  13. Dim i As AcadObject
  14. For Each i In layerObj
  15.            i.Move point1, point2
  16. Next iEnd Sub
帮我看看最后几行吧,有问题呀
回复

使用道具 举报

27

主题

103

帖子

7

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
211
发表于 2004-6-20 10:17:00 | 显示全部楼层
大哥帮忙呀.
我已经写了上面的程序了,可是运行到For Each i In layerObj
出现错误
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-15 21:21 , Processed in 0.628541 second(s), 72 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表