Product : Converter, Version : 4.2.6.1031, ArticleID : 41023634

HowTo : Saving a document using .Save and setting the Filename defore to dwg,dxf,dgn

Article41023634
TypeHowTo
ProductConverter
Version4.2.6.1031
Date Added7/9/2004
Submitted byPatty Snow
Keywords

Subject

Saving a document using .Save and setting the Filename defore to dwg,dxf,dgn

Summary

The following code works with vdf,vdi,vdp.But if you try with dwg,dxf,dgn does not saving the file.
Private Sub Command1_Click()
    vd.ActiveDocument.New
    vd.ActiveDocument.FileName = App.Path + "\lala.vdp"
    vd.ActiveDocument.Save
End Sub

Solution

This is not a bug. Take a look at the example. You have to run the converter in order to save in dwg,dxf,dgn file format.
Private Sub Command1_Click()
    vdraw.ActiveDocument.New
    vdraw.ActiveDocument.FileName = App.Path + "\myfile.dwg"
    vdraw.ActiveDocument.Save
End Sub

Private Sub vdraw_NeedFileConvert(FileToOpen As String, TempFileName As String, ByVal CadVer As VDProLib5.VdConstFileVer, success As Boolean)
Dim parameters As String
Dim destfilename As String
Dim src As String
Dim actions As Long

destfilename = TempFileName
src = FileToOpen

    success = False

    actions = vdraw.ActionValidates
    If Not (actions And 4194304) = 4194304 Then actions = actions + 4194304
    If Not (actions And 8388608) = 8388608 Then actions = actions + 8388608
    parameters = "? " + src + "? " + destfilename + "? " + CStr(CadVer) + " ? 1024 ? 768" + " ? " + CStr(actions) + " ? 0 ? 0 ? 1 ? 0"
    
Dim appPath As String

    appPath = vdraw.GetUserValue("DrawingConvertAppPath", "vdconv.exe") 'find the full path of vdconv.exe
    success = vdraw.VdShellExecute("", appPath, parameters, 1)
    
End Sub