×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

DXF AUTO EXPORT VB PROGRAM 32 BIT VS 64 BIT

DXF AUTO EXPORT VB PROGRAM 32 BIT VS 64 BIT

DXF AUTO EXPORT VB PROGRAM 32 BIT VS 64 BIT

(OP)
We have modified program I got off this site from Cowski that exports out a DXF using the CGM import/Export. It used to work well in the XP 32 bit system. Since we have moved to the windows7 64 bit the program does not work now. What could be hanging this program up from working on one system and not the other?

I have attached VB file

The error I get is invalid DXF message at the end of the program

RE: DXF AUTO EXPORT VB PROGRAM 32 BIT VS 64 BIT

Below is my latest code from the ExportDXF subroutine; I've highlighted a few differences I noticed.
  • I probably should, but my current code does not, call the validate method as your code does. When validate returns a False value, your code aborts the export operation. I put in a call to the validate method as a test and it did return a True value. The Validate method returns false if there is insufficient input to call the Commit method.
  • My code sets the Annotations and Structures properties of the dxfCreator, perhaps these are the "missing" inputs that the creator needs.
  • I've commented out the call to the SetUserCredential method. I've had users on TC test this and since we were only passing in empty strings it didn't seem to be required.

CODE

Sub ExportDXF(ByVal inputFile As String, ByVal outputFile As String)  

    Dim dxfdwgCreator1 As DxfdwgCreator  
    dxfdwgCreator1 = theSession.DexManager.CreateDxfdwgCreator()  
    dxfdwgCreator1.SettingsFile = dxfSettingsFile  
    dxfdwgCreator1.InputFile = inputFile  
    dxfdwgCreator1.OutputFile = outputFile  
    dxfdwgCreator1.FileSaveFlag = False  
    dxfdwgCreator1.ObjectTypes.Curves = True  
    dxfdwgCreator1.ObjectTypes.Annotations = True  
    dxfdwgCreator1.ObjectTypes.Structures = True  
 'next line controls dxf file version
    dxfdwgCreator1.AutoCADRevision = DxfdwgCreator.AutoCADRevisionOptions.R2004  
    dxfdwgCreator1.FlattenAssembly = False  
    dxfdwgCreator1.ViewEditMode = True  
    dxfdwgCreator1.LayerMask = "1-256"  
    dxfdwgCreator1.DrawingList = ""  
    dxfdwgCreator1.ViewList = "TOP,FRONT,RIGHT,BACK,BOTTOM,LEFT,TFR-ISO,TFR-TRI"  
 'dxfdwgCreator1.SetUserCredential("", "", "")

    Try  
        Dim nXObject1 As NXObject  
        nXObject1 = dxfdwgCreator1.Commit()  
    Catch ex As Exception  
        MsgBox("Error in DXF export subroutine" & vbCrLf & ex.GetType.ToString & " : " & ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "DXF export error")  
        lg.WriteLine("Error in ExportDXF subroutine: " & ex.GetType.ToString & " : " & ex.Message)  
    Finally  
        dxfdwgCreator1.Destroy()  
    End Try  

End Sub 

First, I'd try adding the Annotations and Structures lines; if it still doesn't work, try commenting out the SetUserCredentials line. If it still doesn't work after that I'd check the log file after running the journal to see if there are any hints in there as to why it isn't completing. Also, I'd check to make sure the latest .NET framework and patches are installed.

As a last resort, I'd try commenting out the call to the Validate method just to see what happens.

www.nxjournaling.com

RE: DXF AUTO EXPORT VB PROGRAM 32 BIT VS 64 BIT

(OP)
I have tried your suggestions. But they did not work. I get a message box please see attached. Something about an embedded object cannot be deleted in isolation. Thanks for the feedback. I was thinking of permissions on our machines. We have limited write access to certain areas of our c: drives. I have checked with IT and we have write access to the path shown on the error messages. What locations on our hard drives do I need full control access to on our c:drives?

RE: DXF AUTO EXPORT VB PROGRAM 32 BIT VS 64 BIT

(OP)
Cool once again thanks. We will look into these issues. Sounds like it is a windows 7 issue. We will try this and will post back the results

RE: DXF AUTO EXPORT VB PROGRAM 32 BIT VS 64 BIT

(OP)
Found out what the issue was through GTAC. It had to do with "validate" I commented out 'dxfdwgValid = dxfdwgCreator1.Validate()
and added dxfdwgValid = true

The GTAC guy did not understand why the Validate kept sending back a False Flag. So this now works. Once again thanks for the Help cowski.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources