雪山飞狐_lzh 发表于 2004-8-22 13:28:00

本帖最后由 作者 于 2004-8-23 8:45:34 编辑

Lisp代码(defun c:testpf(/ oldstr oldint ss)
(setq oldstr (getvar "users1"))
(setq oldint (getvar "useri1"))
(setvar "users1" "T")
(setq ss (cadr (ssgetfirst)))
(setvar "useri1" 0)
(if ss (setvar "useri1" (sslength ss)))
(sssetfirst nil nil)
(vla-RunMacro (vlax-get-acad-object) "TlsCad.dvb!mTest.testpf")
(if (= (getvar "users1") "T")
   (sssetfirst nil (ssget "_p"))
)
(setvar "useri1" oldint)
(setvar "users1" oldstr)
(princ)
)
VBA代码Sub testpf()
On Error Resume Next
Dim ss As AcadSelectionSet
Dim ft(0) As Integer, fd(0)
Dim pfCount As Integer
pfCount = ThisDrawing.GetVariable("useri1")
ThisDrawing.ActiveSelectionSet.Delete
ThisDrawing.SelectionSets("tlstest").Delete
Set ss = ThisDrawing.SelectionSets.Add("tlstest")
ft(0) = 0: fd(0) = "Line"
ss.SelectOnScreen ft, fd
If ss.Count = 0 And pfCount = 0 Then
       ThisDrawing.SetVariable "users1", "F"
End If
End Sub
页: 1 [2]
查看完整版本: SelectOnScreen选择完回车后,无法将选好的对象留给cad,求助。