Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anyone help ? I try to create drawing directly from model.
Imports System.IO
Sub Main()
AskCreateDrawing = MessageBox.Show("Create drawing for this Current Model?", "Create Drawing", MessageBoxButtons.YesNo)
If AskCreateDrawing = vbYes Then
Else
End If
AskSaveModel = MessageBox.Show("Save Current Model before create drawing", "Save Model", MessageBoxButtons.YesNo)
If AskSaveModel = vbYes Then
iLogicVb.RunRule("Save")
End If
oNewDrawing = ThisDoc.ChangeExtension(".idw")
oTemplateFolder = ThisApplication.DesignProjectManager.ActiveDesignProject.TemplatesPath
Dim oList As New ArrayList
Dim Folder As New IO.DirectoryInfo(oTemplateFolder)
For Each File As IO.FileInfo In Folder.GetFiles("*.idw", IO.SearchOption.AllDirectories)
Dim sName As New FileInfo(File.Name)
oList.Add(sName.Name)
Next
oTemplate = InputListBox("Select a template", oList, oList(0), "iLogic", "List")
oTemplate = oTemplateFolder & oTemplate
Logger.Info(oTemplate)
Dim oDrawingDoc As DrawingDocument
oDrawingDoc = ThisApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, oTemplate, True)
End Sub
Imports System.IO
Sub Main()
AskCreateDrawing = MessageBox.Show("Create drawing for this Current Model?", "Create Drawing", MessageBoxButtons.YesNo)
If AskCreateDrawing = vbYes Then
Else
End If
AskSaveModel = MessageBox.Show("Save Current Model before create drawing", "Save Model", MessageBoxButtons.YesNo)
If AskSaveModel = vbYes Then
iLogicVb.RunRule("Save")
End If
oNewDrawing = ThisDoc.ChangeExtension(".idw")
oTemplateFolder = ThisApplication.DesignProjectManager.ActiveDesignProject.TemplatesPath
Dim oList As New ArrayList
Dim Folder As New IO.DirectoryInfo(oTemplateFolder)
For Each File As IO.FileInfo In Folder.GetFiles("*.idw", IO.SearchOption.AllDirectories)
Dim sName As New FileInfo(File.Name)
oList.Add(sName.Name)
Next
oTemplate = InputListBox("Select a template", oList, oList(0), "iLogic", "List")
oTemplate = oTemplateFolder & oTemplate
Logger.Info(oTemplate)
Dim oDrawingDoc As DrawingDocument
oDrawingDoc = ThisApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, oTemplate, True)
End Sub
Solved! Go to Solution.