Hi
habe mir ein kleines makro gebastelt was eine gerade geöffnete idw als dwg abspeichert.
funktioniert soweit auch supper auser das alle dwg 2.dwg heißen
wie bekomme ich es hin das sie den namen der idw haben ?
hier mein code
Code:
Public Sub DWGOutUsingTranslatorAddIn()
' Set a reference to the DWG translator add-in.
Dim oDWGAddIn As TranslatorAddIn
Dim i As Long
For i = 1 To ThisApplication.ApplicationAddIns.Count
If ThisApplication.ApplicationAddIns.Item(i). _
ClassIdString = _
"{C24E3AC2-122E-11D5-8E91-0010B541CD80}" Then
Set oDWGAddIn = ThisApplication. _
ApplicationAddIns.Item(i)
Exit For
End If
Next
If oDWGAddIn Is Nothing Then
MsgBox "The DWG add-in could not be found."
Exit Sub
End If
' Check to make sure the add-in is activated.
If Not oDWGAddIn.Activated Then
oDWGAddIn.Activate
End If
' Create a name-value map to supply information
' to the translator.
Dim oNameValueMap As NameValueMap
Set oNameValueMap = ThisApplication. _
TransientObjects.CreateNameValueMap
Dim strIniFile As String
strIniFile = "C:\temp\DWGOut.ini"
' Create the name-value that specifies
' the ini file to use.
Call oNameValueMap.Add _
("Export_Acad_IniFile", strIniFile)
' Create a translation context and define
' that we want to output to a file.
Dim oContext As TranslationContext
Set oContext = ThisApplication.TransientObjects. _
CreateTranslationContext
oContext.Type = kFileBrowseIOMechanism
' Define the type of output by
' specifying the filename.
Dim oOutputFile As DataMedium
Set oOutputFile = ThisApplication. _
TransientObjects.CreateDataMedium
oOutputFile.FileName = "c:/temp/2.dwg"
' Call the SaveCopyAs method of the add-in.
Call oDWGAddIn.SaveCopyAs _
(ThisApplication.ActiveDocument, _
oContext, _
oNameValueMap, _
oOutputFile)
End Sub
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP