AutoCADr14能否打开含有VBA内嵌程序的DWG文件?我在2002中编了一段程序如下(节选),运行正常,可另存在r14中怎么能看到图形呢?(我这样做是为了不让别的图形采用本图的元素,但运行本图时需要看得见,只是不能修改,一般只要能做到就行了,有高手能打开也没办法)另外,有一对话框userform1中需密码验证,我在DWG文件中找到了源程序"if textbox1.value = "12345" then",也就是说密码公开了,怎么办?我也想过不用对话框,只用getstring函数.
Private Sub AcadDocument_BeginClose()
On Error Resume Next
Unload UserForm1
ThisDrawing.Application.Preferences.Selection.PickFirst = True
ThisDrawing.Application.Preferences.Selection.DisplayGrips = True
Dim sela As Variant
Dim obj As Object
Set sela = ThisDrawing.Layers
For Each obj In sela
obj.Lock = False
Next
Set sela = ThisDrawing.ModelSpace
For Each obj In sela
obj.Visible = False
Next
ThisDrawing.Save
End Sub