Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting drawing to dxf not to scale

Status
Not open for further replies.

srose99

Mechanical
Jun 24, 2014
9
I am trying to export a NX drafting file to a dxf format by using a journal. The journal function works but if the drawing is scaled how do I change the journal to make it 1:1? The new dxf will be used by other departments for measurments and should be 1:1.

Below is part of the code I changed that will scale the dxf but only if the drawing was 1:2.
What can I replace for the factor of 2 in order for this to work on any scaled drawing sheet?

Sub ExportCGM(ByVal dwg As Drawings.DrawingSheet, ByVal outputFile As String, ByVal units As Integer)

Dim filenames1(0) As String
Dim objCGM As CGMBuilder
objCGM = theSession.Parts.Work.PlotManager.CreateCgmBuilder()

objCGM.Action = CGMBuilder.ActionOption.FileBrowser
objCGM.Size = CGMBuilder.SizeOption.ScaleFactor
objCGM.Scale = 2
 
Replies continue below

Recommended for you

Are all the views on your drawing the same scale?
If so, you can query the scale of one of the views and use the reciprocal of the value in the ExportCGM subroutine.

www.nxjournaling.com
 
The views are the same scale.

How would I query the scale and put that in the subroutine?

I have little experience in modifying/writing journals.

thanks
 
me said:
Are all the views on your drawing the same scale?
If so, you can query the scale of one of the views and use the reciprocal of the value in the ExportCGM subroutine.

Scratch that. The CGM export scale doesn't work quite the way I expected, you can only use it to scale down a view. If the view scale is less than 1, it can't be used to scale a view back up to full scale. I have an idea for a work-around, but have not tested it yet...

www.nxjournaling.com
 
I think the cgm will work the way you had expected. I modified your journal by putting the scale factor to equal 2.

objCGM.Size = CGMBuilder.SizeOption.ScaleFactor
objCGM.Scale = 2

I have a drawing that is 1:2 and after using the journal with the scale set to 2 the drawing was 1:1 when I opened it as a dxf.
 
In my testing, I was getting some strange results if the sheet scale was changed after the views were added. I haven't fully explored the ramifications of changing sheet scale/view scale, but the following journal seems to work in most cases. If you run into an issue that you can duplicate, please let me know...

NXJ_export_dxf_fullscale.vb

www.nxjournaling.com
 
So far it is working. I'll let you know if I find a case where it doesn't work.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor