Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function vbdPowerSet(strName As String) As AcadSelectionSet
'
' Title : vbdPowerSet
'
' Version : 1.0.0
' Author(s) : Randall Rath
' Created : 03/20/2002 01:45:37 PM
' Last Edit : 03/20/2002 01:45:37 PM, TDC
'
' Description:
' »»»»»»»»»»»»
' This function to add a new selection set by name, and check
' for an existing selection set.
'
' Additional files/functions required:
' »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
' 1) None
'
' Example usage:
' »»»»»»»»»»»»»»
' Set ssTitleBlocks = vbdPowerSet("TITLEBLOCKS_SSET")
'
' Requires the following variables:
' »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
' * Input assignments
' 1) strName - A string for any named sets within the
' drawing for vbdPowerSet to search.
'
' Updates:
' »»»»»»»»
' 03/20/2002 01:45:37 PM - 1.0.0 - TDC
' 1) Initially created
'
' Future considerations:
' »»»»»»»»»»»»»»»»»»»»»»
' 1) None
'
' vbdPowerSet begins here:
' ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
Dim objSelSet As AcadSelectionSet
Dim objSelCol As AcadSelectionSets
Set objSelCol = ThisDrawing.SelectionSets
For Each objSelSet In objSelCol
If objSelSet.Name = strName Then
objSelCol.Item(strName).Delete
Exit For
End If
Next
Set objSelSet = objSelCol.Add(strName)
Set vbdPowerSet = objSelSet
End Function
Public Sub BuildFilter(typeArray, dataArray, ParamArray gCodes())
'
' Title : BuildFilter
'
' Version : ?.?.?
' Author(s) : Frank Oquendo
' Created : 03/20/2002 11:17:43 AM
' Last Edit : 03/20/2002 11:17:43 AM, TDC
'
' Description:
' »»»»»»»»»»»»
' This routine is used to fill a pair of variants
' with arrays for use as a selection set filter.
'
' Additional files/functions required:
' »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
' 1) None
'
' Requires the following variables:
' »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
' * Input assignments
' 1) typeArray - An integer array of DXF codes.
' 2) dataArray - A Variant array of DXF code descriptions.
'
' Example usage:
' »»»»»»»»»»»»»»
' BuildFilter intData, varData, -4, "<and", _
' 0, "INSERT", _
' 2, "TB*", _
' -4, "and>"
'
' Updates:
' »»»»»»»»
' 03/20/2002 11:17:43 AM - 1.0.0 - TDC
' 1) Initially created
'
' Future considerations:
' »»»»»»»»»»»»»»»»»»»»»»
' 1) None
'
' BuildFilter begins here:
' ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù
Dim fType() As Integer, fData()
Dim index As Long, i As Long
index = LBound(gCodes) - 1
For i = LBound(gCodes) To UBound(gCodes) Step 2
index = index + 1
ReDim Preserve fType(0 To index)
ReDim Preserve fData(0 To index)
fType(index) = CInt(gCodes(i))
fData(index) = gCodes(i + 1)
Next
typeArray = fType: dataArray = fData
End Sub
Dim intData(0 to 8) As Integer
Dim varData(0 to 8) As Variant
Dim dblPnt(0 to 2) As Double
intData(0) = 0 : varData(0) = "INSERT"
intData(1) = -4 : varData(1) = "<or"
intData(2) = 70 : varData(2) = 0
intData(3) = 70 : varData(3) = 2
intData(4) = -4 : varData(4) = "<and"
intData(5) = 2 : varData(5) = "`*U#*"
intData(6) = -4 : varData(6) = "*,*,<>"
intData(7) = 10 : varData(7) = dblPnt
intData(8) = -4 : varData(8) = "and>"
intData(9) = -4 : varData(9) "or>"
' Ensure a selection set is not already in memory.
'
Set ssTitleBlock = vbdPowerSet("SSET_BLOCKS")
' Build the selection set.
'
ssTitleBlock.Select Mode:=acSelectionSetAll, FilterType:=intData,
FilterData:=varData
' Was anything actually found?
'
If ssBlock.Count = 0 Then
...
..
Dim intData() As Integer
Dim varData() As Variant
Dim dblPnt(0 to 2) As Double
BuildFilter intData, varData, 0, "INSERT", _
-4, "<or", _
70, 0, _
70, 2, _
-4, "<and", _
2, "`*U#*", _
-4, "*,*,<>", _
10, dblPnt, _
-4, "and>", _
-4, "or>"
' Ensure a selection set is not already in memory.
'
Set ssTitleBlock = vbdPowerSet("SSET_BLOCKS")
' Build the selection set.
'
ssTitleBlock.Select Mode:=acSelectionSetAll, FilterType:=intData,
FilterData:=varData
' Was anything actually found?
'
If ssBlock.Count = 0 Then
...
..