03-15-2022
05:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-15-2022
05:05 AM
Hello
This snippet can do the export
Sub PublishDWG(ByVal oDoc As Document,ByVal sFolder As String, ByVal sFileName As String, sSospensione As String,ByVal srif As String, ByVal sDesc As String)
' Get the DWG translator Add-In.
Dim DWGAddIn As TranslatorAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC2-122E-11D5-8E91-0010B541CD80}")
'Create translation context
Dim oContext As TranslationContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = kFileBrowseIOMechanism
' Create a NameValueMap object
Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
' Create a DataMedium object
Dim oDataMedium As DataMedium = ThisApplication.TransientObjects.CreateDataMedium
'Set the destination file name
oDataMedium.FileName = oDataMedium.FileName = sFolder & "\" & sFilename & "_" & sSospensione & srif & sDesc & ".dwg"
'Publish document.
Call DWGAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
End Sub
You have to call it from your main sub
PublishDWG(oRefDoc,sFolder,sFileName,sSospensione,srif,sDesc)
R. Krieg
RKW Solutions
www.rkw-solutions.com