×
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

Batch DXF export

Batch DXF export

Batch DXF export

(OP)
Hello together,

I found the following journal:

http://www.nxjournaling.com/content/export-drawing...

But I could not get it running in NX 9.0.

I recorded the following journal. How could I modify it to batch export a complete folder with files?

CODE -->

' NX 9.0.1.3
Option Strict Off
Imports System
Imports NXOpen

Module NXJournal
Sub Main (ByVal args() As String) 

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work

Dim displayPart As Part = theSession.Parts.Display

' ----------------------------------------------
'   Menu: Orient View->Front
' ----------------------------------------------
workPart.ModelingViews.WorkView.Orient(View.Canned.Front, View.ScaleAdjustment.Current)

' ----------------------------------------------
'   Menu: View->Operation->Fit
' ----------------------------------------------
workPart.ModelingViews.WorkView.Fit()

' ----------------------------------------------
'   Menu: File->Export->AutoCAD DXF/DWG...
' ----------------------------------------------
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")

Dim dxfdwgCreator1 As DxfdwgCreator
dxfdwgCreator1 = theSession.DexManager.CreateDxfdwgCreator()

dxfdwgCreator1.ExportData = DxfdwgCreator.ExportDataOption.Drawing

dxfdwgCreator1.AutoCADRevision = DxfdwgCreator.AutoCADRevisionOptions.R2004

dxfdwgCreator1.ViewEditMode = True

dxfdwgCreator1.FlattenAssembly = True

dxfdwgCreator1.SettingsFile = "C:\Program Files\Siemens\NX 9.0\DXFDWG\dxfdwg.def"

dxfdwgCreator1.OutputFile = "C:\Temp\Test_01.dxf"

dxfdwgCreator1.ExportData = DxfdwgCreator.ExportDataOption.Modeling

dxfdwgCreator1.ObjectTypes.Curves = True

dxfdwgCreator1.ObjectTypes.Annotations = True

dxfdwgCreator1.ObjectTypes.Structures = True

dxfdwgCreator1.FlattenAssembly = False

dxfdwgCreator1.InputFile = "C:\Temp\Test_01.prt"

theSession.SetUndoMarkName(markId1, "AutoCAD DXF/DWG Export Wizard  Dialog")

' ----------------------------------------------
'   Dialog Begin AutoCAD DXF/DWG Export Wizard 
' ----------------------------------------------

Dim markId2 As Session.UndoMarkId
markId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "AutoCAD DXF/DWG Export Wizard ")

theSession.DeleteUndoMark(markId2, Nothing)

Dim markId3 As Session.UndoMarkId
markId3 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "AutoCAD DXF/DWG Export Wizard ")

dxfdwgCreator1.TextFontMappingFile = "C:\Users\User\AppData\Local\Temp\User16C4C08573fr.txt"

dxfdwgCreator1.WidthFactorMode = DxfdwgCreator.WidthfactorMethodOptions.AutomaticCalculation

dxfdwgCreator1.CrossHatchMappingFile = "C:\Users\User\AppData\Local\Temp\User16C4C08573fs.txt"

dxfdwgCreator1.LineFontMappingFile = "C:\Users\User\AppData\Local\Temp\User16C4C08573ft.txt"

dxfdwgCreator1.LayerMask = "1-256"

dxfdwgCreator1.ViewList = "Left"

Dim nXObject1 As NXObject
nXObject1 = dxfdwgCreator1.Commit()

theSession.DeleteUndoMark(markId3, Nothing)

theSession.SetUndoMarkName(markId1, "AutoCAD DXF/DWG Export Wizard ")

dxfdwgCreator1.Destroy()

End Sub
End Module 

Thank you very much

Goof

Siemens NX 8.5 / 9.0

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