使用LoadDVB。
- Sub Example_LoadDVB()
- ' This example loads a DVB file into AutoCAD the VBA system and runs a macro
- ' contained in the file using the RunMacro method.
- '
- ' For this example, use one of the sample files installed
- ' with the system, so the file name may
- ' have to be modified.
- '
- ' * Note: If the he drawline DVB is already open, there will be an error
- ' when trying to unload the drawline DVB.
- Dim FileName As String
-
- FileName = "c:\program files\autocad\sample\vba\drawline.dvb"
-
- ' Load a sample VBA project DVB file
- LoadDVB FileName
-
- ' Run the drawline sample macro
- RunMacro "Module1.Drawline"
-
- ' Unload the drawline VBA project DVB file now.
- UnloadDVB FileName
-
- MsgBox "We just loaded, ran, and unloaded a VBA sample from code!"
- End Sub
|