Message 1 of 16
open a drawing in LOD with ilogic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I have an Ilogic rule that will open a list of drawing on a txt file and create a dwfx for each.
Is it possiable to open the drawings in a specific LOD called 'Simple' before the dxf is created.
I know that you can change the lod onced open before the dwfx is created but can I open straight from the LOD to speed things up?
Regards
Warren.
SyntaxEditor Code Snippet
Imports System.IO
'open and read a text file
Dim oRead As New StreamReader("C:\dwglist.csv")
Dim sLine As String = ""
Dim MyArrayList As New ArrayList
'build list from text file
Do
sLine = oRead.ReadLine()
If Not sLine Is Nothing Then
Dim oDoc As Document
odoc = ThisApplication.Documents.Open(sLine, True)
'CHANGE FILENAME TO SUIT FILE USING THE IPROPERTIES EMBEDDED IN THE PLANT ITEM
FileName = iProperties.Value("Custom", "BUILDING_NO") & "_" & iProperties.Value("Custom", "PLANT_NO") & "_" & iProperties.Value("Project", "Description")
'CHANGE SAVE LOCATION TO SUIT FILE
If iProperties.Value("Custom", "SYSTEM") = "010" Then
SaveLocationDWFX = "C:\10\"
SaveLocationDWG = "C:\10\"
Else If iProperties.Value("Custom", "SYSTEM") = "020" Then
SaveLocationDWFX = "C:\20\"
SaveLocationDWG = "C:\20\"
End If
DWFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD95-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium
If DWFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
'PUBLISHES ALL IPROPS WITHIN THE DWFX EXPORT
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oOptions.Value("Launch_Viewer") = 0
oOptions.Value("Publish_All_Component_Props") = 1
oOptions.Value("Publish_All_Physical_Props") = 1
oOptions.Value("Publish_All_User_Defined_Properties_Props") = 1
oOptions.Value("Publish_All_Summary_Information_Props") = 1
oOptions.Value("Publish_All_Document_Summary_Information_Props") = 1
oOptions.Value("Publish_All_Design_Tracking_Properties_Props") = 1
oOptions.Value("Publish_All_TEST_TAB") = 1
oOptions.Value("Password") = 0
oOptions.Value("Publish_Mode") = DWFPublishModeEnum.kCompleteDWFPublish
End If
'Set the destination file name
oDataMedium.FileName = SaveLocationDWFX & FileName & ".dwfx"
oDataMedium.FileName = SaveLocationDWG & FileName & ".dwg"
'Publish document.
Call DWFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium)
odoc.Close
End If
Loop Until sLine Is Nothing
oRead.Close()