Exporting multi-sheet IDW to dxf (ilogic)

Exporting multi-sheet IDW to dxf (ilogic)

Darius_CAD
Enthusiast Enthusiast
5,450 Views
21 Replies
Message 1 of 22

Exporting multi-sheet IDW to dxf (ilogic)

Darius_CAD
Enthusiast
Enthusiast

Hello,

 

I have already explored some of the posts regarding this subject.  But didn't find a solution.

 

Problem:   When I run rule (exporting multi-sheet IDW to DXF), DXF files have unnecessary first symbol "_" (please look at "1" .jpg).

I need:      That rule will check: if file name has this symbol "_" - delete (or skip this symbol), if file name not have it (when idw has one sheet), just leave file name.

 

My rule (exporting IDW to DXF):

' Get the DXF translator Add-In.  
Dim DXFAddIn As TranslatorAddIn  
DXFAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}")  
'Set a reference to the active document (the document to be published).  
Dim oDocument As Document  
oDocument = ThisApplication.ActiveDocument  
Dim oContext As TranslationContext  
oContext = ThisApplication.TransientObjects.CreateTranslationContext  
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism  
' Create a NameValueMap object  
Dim oOptions As NameValueMap  
oOptions = ThisApplication.TransientObjects.CreateNameValueMap  
' Create a DataMedium object  
Dim oDataMedium As DataMedium  
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium  
' Check whether the translator has 'SaveCopyAs' options  
If DXFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then  
Dim strIniFile As String  
strIniFile = "C:\CAD_2007.ini"  
' Create the name-value that specifies the ini file to use.  
oOptions.Value("Export_Acad_IniFile") = strIniFile  
End If  
'Set the destination file name 
oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension

'----
'get DXF target folder path
oFolder = oPath & "\1.2_DXF"

'Check for the DXF 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 & "\" & "" &".dxf"

'long name
'oDataMedium.FileName = oFolder & "\" & oFileName &".dxf"

'-----
'oDataMedium.FileName = ThisDoc.PathAndFileName(False) & ".dxf" 'same folder, or uncomment:
'oDataMedium.FileName = "C:\myDXFfolder\" & ThisDoc.FileName(False) & ".dxf" 'fixed folder
'Publish document.
DXFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)

 

Any help would help out alot.... thanks!

 

 

0 Likes
Accepted solutions (1)
5,451 Views
21 Replies
Replies (21)
Message 21 of 22

Darius_CAD
Enthusiast
Enthusiast
Hi,
Sheet names should be diferent. ?
0 Likes
Message 22 of 22

aronmatheus
Advocate
Advocate

Is there a way to export idw to dxf using logic to put all sheets in the same file dxf layout 1 and layout 2?

0 Likes