求助:如何利用vba实现将当前图形输出为.sat 的格式的文件
本帖最后由 作者 于 2003-2-20 22:34:23 编辑请教各位,如何利用vba实现将当前图形输出为.sat 的格式的文件
[此贴子已经被作者于2003-2-20 22:29:16编辑过]
[此贴子已经被作者于2003-2-20 22:30:11编辑过]
这样
Sub main()Dim acadapp As AcadApplication
Dim thisdrawing As AcadDocument
Set acadapp = GetObject(, "autocad.application.15")
Set thisdrawing = acadapp.ActiveDocument
Dim sel As AcadSelectionSet
Set sel = thisdrawing.ActiveSelectionSet
sel.Select acSelectionSetAll
thisdrawing.Export "c:\xx.sat", "sat", sel
End Sub
(defun c:main (/ activeselectionset thisdrawing)
(vl-load-com)
(setq thisdrawing (vla-get-activedocument (vlax-get-acad-object)))
(setq activeselectionset (vla-get-activeselectionset thisdrawing))
(vlax-invoke-method
activeselectionset
"select"
acSelectionSetAll
)
(vlax-invoke-method
thisdrawing "Export" "c:\\xxx.sat" "sat" activeselectionset)
(vlax-release-object activeselectionset)
(vlax-release-object thisdrawing)
)
谢谢
多谢赐教
页:
[1]