tiancao1001 于 2008-11-01 02:46 PM 发表评论: |
|
查看所评论的日志:田草日志 |
tiancao1001 于 2008-10-31 02:47 PM 发表评论: |
|
查看所评论的日志:田草日志 |
tiancao1001 于 2008-10-28 10:47 PM 发表评论: |
来自晓东CAD的一个方法
也许并不是一个Bug,而是我们没发现罢了
代码:
Sub Example_PickfirstSelectionSet() ' This example lists all the objects in the pickfirst selection set. ' Before running this example, create some objects in the active ' drawing and select those objects. The objects currently selected ' in the active drawing will be returned in the pickfirst selection set. Dim pfSS As AcadSelectionSet Dim ssobject As AcadEntity Dim msg As String msg = vbCrLf Set pfSS = ThisDrawing.PickfirstSelectionSet For Each ssobject In pfSS msg = msg & vbCrLf & ssobject.ObjectName Next ssobject MsgBox "The Pickfirst selection set contains: " & msg End Sub
以上的例子在IDE窗口中运行没问题 调用-vbarun命令运行时不能正确运行 可以用下列方法j解决 定义Lisp函数:
代码:
(defun tls-sub2cmd(filename subname cmdname) (eval (list 'defun (read (strcat "c:" cmdname)) nil '(if (cadr(ssgetfirst)) (sssetfirst nil (ssget))) (list 'vla-RunMacro '(vlax-get-acad-object) (strcat filename "!" subname) ) '(sssetfirst nil nil) '(princ) ) ) (vlax-add-cmd cmdname (strcat "C:" cmdname)) (princ) )
调用格式为: (tls-sub2cmd "文件名" "宏名" "命令名") |
|
查看所评论的日志:CAD VBA 先选择后操作 PickfirstSelectionSet |
tiancao1001 于 2008-10-13 02:55 PM 发表评论: |
隐藏日志的评论 |
查看所评论的日志:CAD VBA 也能画出这样的样条曲线 |
tiancao1001 于 2008-10-10 05:58 PM 发表评论: |
|
查看所评论的日志:田草日志 |
tiancao1001 于 2008-10-10 04:22 PM 发表评论: |
|
查看所评论的日志:田草日志 |
tiancao1001 于 2008-10-08 10:56 PM 发表评论: |
|
查看所评论的日志:田草日志 |
tiancao1001 于 2008-10-08 10:44 PM 发表评论: |
|
查看所评论的日志:田草日志 |