Professional Documents
Culture Documents
'A custom type that holds the scale factors of the block.
X As Double
Y As Double
Z As Double
End Type
Sub InsertBlocks()
Dim i As Long
height = 150
With Sheets("AC-SDNL")
.Activate
End With
MsgBox "There are no coordinates for the insertion point!", vbCritical, "Insertion Point Error"
Exit Sub
End If
'Check if AutoCAD application is open. If is not opened create a new instance and make it visible.
acadApp.Visible = True
End If
Exit Sub
End If
On Error GoTo 0
'If there is no active drawing create a new one.
End If
On Error GoTo 0
'Check if the active space is paper space and change it to model space.
End If
'Loop through all the rows and add the corresponding blocks in AutoCAD.
With Sheets("AC-SDNL")
For i = 2 To LastRow
BlockScale.Y = 1
BlockScale.Z = 1
RotationAngle = 0
'Add the block using the sheet data (insertion point, block name, scale factors and rotation
angle).
If acadBlock.HasAttributes Then
Dim j As Integer
AttList = acadBlock.GetAttributes
Next
End If
End If
Next i
End With
End Sub