- 积分
- 476
- 明经币
- 个
- 注册时间
- 2004-8-4
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
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一窍不通所以不会改
|
|