ironwill 发表于 2004-9-18 10:28:00

[求助]关于“实现模块插入时后的预览和随鼠标移动“的修改

<FONT id=text1 style="FONT-SIZE: 10pt" face="宋体,verdana, arial, helvetica"><BR>Public Sub BlockInsert(Name As String)<BR>'调用VLAX类实现在VBA下编写AutoLisp程序<BR>'从而实现模块插入时后的预览和随鼠标移动<BR><BR>On Error Resume Next<BR>Dim pLisp As String<BR>Dim obj As VLAX<BR>Dim pnt(2) As Double<BR>Set obj = New VLAX<BR>If BlockScale &lt;= 0 Then BlockScale = 1<BR>Set pobj = ThisDrawing.ModelSpace.InsertBlock(pnt, Name, BlockScale, BlockScale, BlockScale, 0)<BR>obj.EvalLispExpression "(setq ed (entget (handent " &amp; ToStr(pobj.Handle) &amp; ")))"<BR>pLisp = "(while (not (= (caddr " &amp; _<BR>"(setq pTime (grread t) " &amp; _<BR>"pSt (car pTime) " &amp; _<BR>"pnt (cond ((= pSt 3) (List 0 0 -1)) ((= pSt 5) (cadr pTime)) (t (List 0 0 1))))) -1)) " &amp; _<BR>"(setq ed (subst (cons 10 pnt) (assoc 10 ed) ed)) " &amp; _<BR>"(entmod ed) " &amp; _<BR>") "<BR>obj.EvalLispExpression pLisp<BR>pobj.Highlight (True)<BR>Set obj = Nothing<BR>End Sub<BR>上代码拷贝与此网站,且运行正常<BR>我想加上右键取消插入,怎么改?<BR>我对Lisp一窍不通所以不会改</FONT> <BR>

ironwill 发表于 2004-9-19 09:20:00

为什么没人回答?

雪山飞狐_lzh 发表于 2004-9-19 11:36:00

Vlax不太稳定,建议将程序分成两部分,做块在VBA里,插入块在Lisp里
页: [1]
查看完整版本: [求助]关于“实现模块插入时后的预览和随鼠标移动“的修改