lanhuazhang 发表于 2003-2-20 22:34:00

求助:如何利用vba实现将当前图形输出为.sat 的格式的文件

本帖最后由 作者 于 2003-2-20 22:34:23 编辑

请教各位,如何利用vba实现将当前图形输出为.sat 的格式的文件

[此贴子已经被作者于2003-2-20 22:29:16编辑过]



[此贴子已经被作者于2003-2-20 22:30:11编辑过]

南子 发表于 2003-2-21 09:31:00

这样

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)
)

lanhuazhang 发表于 2003-2-21 16:43:00

谢谢

多谢赐教
页: [1]
查看完整版本: 求助:如何利用vba实现将当前图形输出为.sat 的格式的文件