- UID
- 162898
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-8-3
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Public Sub BlockInsert(Name As String)
'调用VLAX类实现在VBA下编写AutoLisp程序
'从而实现模块插入时后的预览和随鼠标移动
On Error Resume Next
Dim pLisp As String
Dim obj As VLAX
Dim pnt(2) As Double
Set obj = New VLAX
If BlockScale <= 0 Then BlockScale = 1
Set pobj = ThisDrawing.ModelSpace.InsertBlock(pnt, Name, BlockScale, BlockScale, BlockScale, 0)
obj.EvalLispExpression "(setq ed (entget (handent " & ToStr(pobj.Handle) & ")))"
pLisp = "(while (not (= (caddr " & _
"(setq pTime (grread t) " & _
"pSt (car pTime) " & _
"pnt (cond ((= pSt 3) (List 0 0 -1)) ((= pSt 5) (cadr pTime)) (t (List 0 0 1))))) -1)) " & _
"(setq ed (subst (cons 10 pnt) (assoc 10 ed) ed)) " & _
"(entmod ed) " & _
") "
obj.EvalLispExpression pLisp
pobj.Highlight (True)
Set obj = Nothing
End Sub
上代码拷贝与此网站,且运行正常
我想加上右键取消插入,怎么改?
我对Lisp一窍不通所以不会改 |
|