lisp代码- (defun c:test()
- (setq ss (ssadd) oldusers1 (getvar "users1"))
- (vla-RunMacro (vlax-get-acad-object) "SelectByHandle")
- (setq obj (handent (getvar "users1")))
- (ssadd obj ss)
- (setvar "users1" oldusers1)
- (sssetfirst nil ss)
- )
VBA代码- Sub SelectByHandle()
- Dim ent As AcadEntity, pnt
- ThisDrawing.Utility.GetEntity ent, pnt
- ThisDrawing.SetVariable "users1", ent.Handle
- End Sub
|