Message 1 of 3

Not applicable
02-14-2017
05:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How would I specify the Layout names here?
Public Sub InsertBlocks() Dim blockObj1 As AcadBlockReference Dim blockObj2 As AcadBlockReference Dim blockObj3 As AcadBlockReference Dim InsPoint(0 To 2) As Double InsPoint(0) = 0#: InsPoint(1) = 0#: InsPoint(2) = 0# File1 = "C:\Program Files\Autodesk\AutoCAD 2015\Support\Sheet1.dwg" File2 = "C:\Program Files\Autodesk\AutoCAD 2015\Support\Sheet2.dwg" File3 = "C:\Program Files\Autodesk\AutoCAD 2015\Support\Sheet3.dwg" Set blockObj1 = ThisDrawing.PaperSpace.InsertBlock(InsPoint, File1, 1#, 1#, 1#, 0) 'Layout1 Set blockObj2 = ThisDrawing.PaperSpace.InsertBlock(InsPoint, File2, 1#, 1#, 1#, 0) 'Layout2 Set blockObj3 = ThisDrawing.PaperSpace.InsertBlock(InsPoint, File3, 1#, 1#, 1#, 0) 'Layout3 End Sub
The concept: When a number (1,2,3,etc) is selected from a drop-down list
"1" is selected, "blockObj1" is inserted to Layout1
"2" is selected, "blockObj1" & "blockObj2" are inserted to Layout1 & 2 respectively
"3" is selected, "blockObj1" & "blockObj2" & "blockObj3" are inserted to Layout1, 2, & 3 respectively
...etc...
Solved! Go to Solution.