乐筑天下

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

vba中如何实现鼠标控制三维图形的移动!请高手指点!谢谢!

[复制链接]

1

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
6
发表于 2004-3-24 22:37:00 | 显示全部楼层 |阅读模式
请问斑竹和高手、大侠指点:
vba中如何实现鼠标控制三维图形的移动!请高手指点!谢谢!
回复

使用道具 举报

158

主题

2315

帖子

10

银币

顶梁支柱

Rank: 50Rank: 50

铜币
2951
发表于 2004-3-25 19:53:00 | 显示全部楼层
鼠标是用手控制的,而不是用程序控制的。
回复

使用道具 举报

1

主题

2

帖子

1

银币

初来乍到

Rank: 1

铜币
6
发表于 2004-3-25 21:02:00 | 显示全部楼层
不是这个意思!
我的意思是通过鼠标单击的感应确定三维图形的移动
在vba中实现
请斑竹多多指教
万分感激!谢谢!!
顺便请您帮我检查一下我的程序!
是移动三维图形的!
Public Sub MoveShape()
'move a shape from a to b in one or more step
Dim ShapeObject As Acad3DSolid
Const NumberOfMoves = 200
Dim StartPoint As Variant, EndPoint As Variant
Dim CurrentPosition(0 To 2) As Double
Dim LastPosition As Variant
Dim IncX As Double, IncY As Double, IncZ As Double
Dim Count As Integer, ButtonClicked As Integer
StartPoint = ThisDrawing.Utility.GetPoint(, "Enter the startpoint for the starting position for the direction of the move. ")
EndPoint = ThisDrawing.Utility.GetPoint(StartPoint, "Enter the EndPoint for the Ending Position for the direction of the move")
ButtonClicked = MsgBox("Do you want to animate the move?", vbYesNo, "Moving Shape")
If ButtonClicked = vbYes Then
IncX = (EndPoint(0) - StartPoint(0)) / NumberOfMoves
IncY = (EndPoint(1) - StartPoint(1)) / NumberOfMoves
IncZ = (EndPoint(2) - StartPoint(2)) / NumberOfMoves
        LastPosition = StartPoint
        CurrentPosition(0) = StartPoint(0)
        CurrentPosition(1) = StartPoint(1)
         CurrentPosition(2) = StartPoint(2)
         For Count = 1 To NumberOfMoves
         CurrentPosition(0) = CurrentPosition(0) + IncX
         CurrentPosition(1) = CurrentPosition(1) + IncY
         CurrentPosition(2) = CurrentPosition(2) + IncZ
ShapeObject.Move LastPosition, CurrentPosition
LastPosition = CurrentPosition
ShapeObject.Update
Next
Else
ShapeObject.Move StartPoint, EndPoint
ShapeObject.Update
End If
       
         
End Sub
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-15 16:21 , Processed in 0.484319 second(s), 58 queries .

© 2020-2025 乐筑天下

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