Export to DXF

Export to DXF

marc.cortada396VM
Explorer Explorer
205 Views
1 Reply
Message 1 of 2

Export to DXF

marc.cortada396VM
Explorer
Explorer

Hi to everyone. 

Actually i'm using this code to save the sheet 1 in pdf. 

oPath = ThisDoc.Path
oFileName = Parameter("04.01 Tapa aspiracion TMB.ipt.CODIGO_TMB")& ".04.01 " & Parameter("04.01 Tapa aspiracion TMB.ipt.DENOMINACION_TMB") 'without extension
oRevNum = iProperties.Value("project", "revision number")
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium 


If oPDFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
oOptions.Value("All_Color_AS_Black") = 0
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintSheetRange
oOptions.Value("Custom_Begin_Sheet") = 1
oOptions.Value("Custom_End_Sheet") = 1
End If 


'get PDF target folder path
oFolder = ThisDoc.Path


'Check for the PDF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
    System.IO.Directory.CreateDirectory(oFolder)
End If


 'Set the PDF target file name
oDataMedium.FileName = oFolder & "\" & oFileName & ".pdf" 


'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 
'------end of iLogic-------

I would like to save the sheet 2 to DXF. With the same name and everything the same.

I tried many times but I don't know how to do it.

Any ideas?

Thanks in advance!

0 Likes
206 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor

You will need to prepare a seperate rule to process the dxf at least untill you figure out the process. The API sample has a dxf export macro written in VBA. The next thing is you want to target sheet 2 but the export rule expects there only to be one sheet. So it really won't work as you expect. The alternative is to copy your sheet to a temporary drawing and export that drawing. Discussed in this post here. Have a look at those and see what makes sense to your workflow.

 

Yet another method is to export the flatpattern via the model reference of the drawing. The down side here is you need to hardcode in the export settings that would normally be taken care of in the ini file of the drawing export to dxf. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan