I am working on a project that uses VB to control the application, DWGeditor. Basically, I am starting with a template .dwg file and then inserting others as blocks; essentially layering the files to create a final product. VB has allowed me to create an interface so that I can select various options. Depending on which options are selected different blocks are inserted thereby creating a different diagram. All in all there are about 4,000 different combinations which results in 4,000 unique diagrams. As you can imagine it would not be feasible to generate all these files by hand so I need to automate the process.
This is where I need help. I'm sure I can loop the process pretty easily, but I have no idea where to begin in order to export the file in the automation process. There is a "PDF Out..." feature that exists under the File menu of DWGeditor which I use to manually save the files. If there a way to call this function? The end result should just be a single "Generate" button that will start the process that:
1. Opens template file
2. Inserts blocks
3. Export PDF
4. Close file
5. Go back to #1
Currently I have a .dwg file with the VB script/interface attached. It will open the template file and populate the diagram with the options selected from the interface. I can then manually stop the VB script then select "PDF out..." to create my file. Hopefully this makes sense. Not sure if looking at my current code will help at all, but here are a couple snippets.
CODE
Dim insPrimRelay As DWGeditor.Point 'Block 8: Primary Relay Box
Dim blkPrimRelay As DWGeditor.BlockInsert
Dim insRelayNoteNum As DWGeditor.Point 'Block 10: Relay Note Number
Dim blkRelayNoteNum As DWGeditor.BlockInsert
Dim insSecRelay As DWGeditor.Point 'Block 9: Secondary Relay Box
Dim blkSecRelay As DWGeditor.BlockInsert
CODE
'---------------------------------------[OPENS TEMPLATE DOCUMENT]---------------------------------------
Set docMx = Documents.Open("C:\My Documents\Projects\3D Configurator\template-3-0.dwg")
'---------------------------------[SETS SSMR/NON-SSMR AND RELAY OPTIONS]--------------------------------
If optNonSSMR = True Then 'Adds standard contactor block and notes
Set insContactor = Library.CreatePoint(4.29, 16.29, 0)
Set blkContactor = docMx.ModelSpace.InsertBlock(insContactor, "NONSSMRBLOCK", 1, 1, 1, 0)
If optOS = True Then 'Adds standard relay block and notes
Set insNotes = Library.CreatePoint(9.3, 2.03, 0)
Set blkNotes = docMx.ModelSpace.InsertBlock(insNotes, "NONSSMR_OS_NOTEBLOCK", 1, 1, 1, 0)
Set insPrimRelay = Library.CreatePoint(5.76, 10.56, 0)
Set blkPrimRelay = docMx.ModelSpace.InsertBlock(insPrimRelay, "(S)RELAYBLOCK", 1, 1, 1, 0)
Set insRelaySeeNote = Library.CreatePoint(6.5, 10.65, 0)
Set blkRelaySeeNote = docMx.ModelSpace.InsertBlock(insRelaySeeNote, "SEE7BLOCK", 1, 1, 1, 0)
ElseIf optOA = True Then 'Adds optional relay block and notes
Set insNotes = Library.CreatePoint(9.3, 2.03, 0)
Set blkNotes = docMx.ModelSpace.InsertBlock(insNotes, "NONSSMR_OA_NOTEBLOCK", 1, 1, 1, 0)
Set insPrimRelay = Library.CreatePoint(5.76, 10.56, 0)
Set blkPrimRelay = docMx.ModelSpace.InsertBlock(insPrimRelay, "(R1-4)RELAYBLOCK", 1, 1, 1, 0)
Set insRelayNote = Library.CreatePoint(18.18, 17.6, 0)
Set blkRelayNote = docMx.ModelSpace.InsertBlock(insRelayNote, "OA_RELAYNOTEBLOCK", 1, 1, 1, 0)
ElseIf optOB = True Then 'Adds standard and optional relay blocks and notes
Set insNotes = Library.CreatePoint(9.3, 2.03, 0)
Set blkNotes = docMx.ModelSpace.InsertBlock(insNotes, "NONSSMR_OB_NOTEBLOCK", 1, 1, 1, 0)
Set insPrimRelay = Library.CreatePoint(5.76, 10.56, 0)
Set blkPrimRelay = docMx.ModelSpace.InsertBlock(insPrimRelay, "(S)RELAYBLOCK", 1, 1, 1, 0)
Set insSecRelay = Library.CreatePoint(15.07, 17.68, 0)
Set blkSecRelay = docMx.ModelSpace.InsertBlock(insSecRelay, "(R5-8)RELAYBLOCK", 1, 1, 1, 0)
Set insRelayNote = Library.CreatePoint(18.18, 17.6, 0)
Set blkRelayNote = docMx.ModelSpace.InsertBlock(insRelayNote, "OB_RELAYNOTEBLOCK", 1, 1, 1, 0)
ElseIf optOC = True Then 'Adds dual optional relay blocks and notes
Set insNotes = Library.CreatePoint(9.3, 2.03, 0)
Set blkNotes = docMx.ModelSpace.InsertBlock(insNotes, "NONSSMR_OC_NOTEBLOCK", 1, 1, 1, 0)
Set insPrimRelay = Library.CreatePoint(5.76, 10.56, 0)
Set blkPrimRelay = docMx.ModelSpace.InsertBlock(insPrimRelay, "(R1-4)RELAYBLOCK", 1, 1, 1, 0)
Set insSecRelay = Library.CreatePoint(15.07, 17.68, 0)
Set blkSecRelay = docMx.ModelSpace.InsertBlock(insSecRelay, "(R5-8)RELAYBLOCK", 1, 1, 1, 0)
Set insRelayNote = Library.CreatePoint(18.18, 17.6, 0)
Set blkRelayNote = docMx.ModelSpace.InsertBlock(insRelayNote, "OC_RELAYNOTEBLOCK", 1, 1, 1, 0)
End If