BeetleJuice
2010-05-08, 12:34 PM
I am trying to alter the mode of an attribute i.e ac AttributeModeInvisible, etc)
I can't seem to get the current mode of an attribute.
Here is my code in early stages and hope someone can help.
Sub ToggleRef()
Dim objBRef As AcadBlockReference
Dim varPick As Variant
Dim iCount As Integer
Dim oBlock As AcadBlock
Dim bname As String
Dim SpecValue As Variant
Dim i As Integer
''get an entity from user
On Error Resume Next
With ThisDrawing.Utility
.GetEntity objBRef, varPick, vbCr & "Pick a SRD reference: "
If Err Then Exit Sub
End With
bname = objBRef.Name
Set oBlock = ThisDrawing.Blocks(bname)
iCount = oBlock.count
MsgBox iCount
If objBRef.Name <> "REF1_50" Or objBRef.HasAttributes = False Or iCount <> 3 Then
MsgBox "This Is Not A valid SRD Reference"
Exit Sub
End If
SpecValue = objBRef.GetAttributes
For i = 0 To 2
MsgBox (SpecValue(i).TextString)
'''''''''''MsgBox (SpecValue(i).TextString(i).Mode) '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Next i
End Sub
I can't seem to get the current mode of an attribute.
Here is my code in early stages and hope someone can help.
Sub ToggleRef()
Dim objBRef As AcadBlockReference
Dim varPick As Variant
Dim iCount As Integer
Dim oBlock As AcadBlock
Dim bname As String
Dim SpecValue As Variant
Dim i As Integer
''get an entity from user
On Error Resume Next
With ThisDrawing.Utility
.GetEntity objBRef, varPick, vbCr & "Pick a SRD reference: "
If Err Then Exit Sub
End With
bname = objBRef.Name
Set oBlock = ThisDrawing.Blocks(bname)
iCount = oBlock.count
MsgBox iCount
If objBRef.Name <> "REF1_50" Or objBRef.HasAttributes = False Or iCount <> 3 Then
MsgBox "This Is Not A valid SRD Reference"
Exit Sub
End If
SpecValue = objBRef.GetAttributes
For i = 0 To 2
MsgBox (SpecValue(i).TextString)
'''''''''''MsgBox (SpecValue(i).TextString(i).Mode) '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Next i
End Sub