VB 如何获知CAD中鼠标点击事件
如题,我现在已经将autoCAD嵌入VB Form窗口,接着遇到一个问题,当我点击cad模型中某个位置时,外面的Form窗体如何获知这个事件 我也很想知道啊!也急用! 我现在的方法是通过生成一个定时器,每隔一定的时间去查询pickfirstSelectionset来处理一些事情,效率还算可以.但是当选中的object较多,做的操作复杂时,性能会很差.你不妨试试 恐怖的方法:),不知道你想实现什么样的功能? 怎么样将cad嵌入到vb中啊,大哥,帮帮我吧 BigJue大哥,我也想将cad嵌入到vb中啊,能否教教我啊,不胜感激我的qq号是84365924 '将cad嵌入到vb中<BR>Option ExplicitPrivate Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long<BR>Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long<BR>Private lHwnd As Long
Private Sub Form_Load()<BR> <BR> On Error GoTo ErrTrap<BR> Dim acadApp As Object<BR> Set acadApp = CreateObject("AutoCAD.Application")<BR> acadApp.Visible = True<BR> lHwnd = GetParent(GetParent(acadApp.Activedocument.hwnd))<BR> If lHwnd = 0 Then Exit Sub<BR> SetParent lHwnd, Form1.hwnd<BR> Exit Sub<BR> <BR>ErrTrap:<BR> On Error GoTo 0<BR>End Sub
Private Sub Form_Unload(Cancel As Integer)<BR> If lHwnd = 0 Then Exit Sub<BR> SetParent lHwnd, 0<BR>End Sub<BR>
转自efan2000 太感谢了!
页:
[1]