Message 1 of 22
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!!
i'm trying to run overkill command on a selection set. This is my current code:
*Moderator Edit* changed code language to VB
'select all objects of layer "GapPoints"
Dim tSelSet As AcadSelectionSet
Dim FromLayer As String
FromLayer = "GapPoints"
Dim pSelSetName As String
pSelSetName = "mySelSetGapPoints"
'create SelectionSet
On Error Resume Next
Set tSelSet = acadDoc.SelectionSets.Item(pSelSetName)
If (Not (tSelSet Is Nothing)) Then
tSelSet.Clear
Else
Err.Clear
Set tSelSet = acadDoc.SelectionSets.Add(pSelSetName)
End If
'create selection filter
'Filtering SelectionSet
Dim tDxfCodes(0) As Integer
Dim tDxfValues(0) As Variant
tDxfCodes(0) = 8
tDxfValues(0) = FromLayer
'create selection
Call tSelSet.Select(acSelectionSetAll, , , tDxfCodes, tDxfValues)
Dim acadcommand As String
'acadcommand = """" & "_-overkill" & """" & ", tSelSet, " & """" & """" & ", " & """" & """"
acadcommand = "_-overkill" & vbCr & "tSelSet" & vbCr & vbCr
' run overkill command on created selection set previously
acadApp.ActiveDocument.SendCommand acadcommand & vbCr
Both lines 32 and 33 give error.
Does anybody knows to to run overkill command on a selection set via Excel VBA please?
Many thanks! 🙂
Solved! Go to Solution.