Trouble getting with Block attributes iCAD 7.2: SOLVED
Posted: Thu Oct 11, 2012 8:14 am
This snippet of code is for a parking space counter for land surveying. It goes through and counts the times a special handicapped symbol is placed. That part is easy. One instance of the block is one space. Regular parking spaces are counted by looking at the block, which has one attribute for the amount of parking spaces, and retrieving the textstring for that attribute.
It appears that calling the line
results in no action. No message box is displayed. I've tried using an index of 1, but as per earlier posts from valued contributors, all selection sets are zero-based now in IntelliCAD. Using an index of 1 doesn't seem to make any difference. If I comment out the variable part of that message box, it is displayed.
Does anyone know the proper method or more details on working with the GetAttributes property? All the examples I've found seem to match the methods I've used.
[/code]
It appears that calling the line
Code: Select all
MsgBox " OUTPUT : " & varAtts.Item(0).textStringDoes anyone know the proper method or more details on working with the GetAttributes property? All the examples I've found seem to match the methods I've used.
Code: Select all
For i = 0 To (entcount - 1)
Set objEntity = ThisWorkspace.ActiveDocument.ModelSpace.Item(i)
If objEntity.EntityType = vicBlockInsert And objEntity.Layer = "TRAFFIC" Then
Set objBlockRef = objEntity
BLOCKNAME = objBlockRef.Name
If BLOCKNAME = "HANDICAP" Then HCOUNT = HCOUNT + 1
If BLOCKNAME = "PARKING SPACES" Then
MsgBox objBlockRef.GetAttributes.count 'Returns 1 which is correct
Set varAtts = objBlockRef.GetAttributes
'PROBLEM: THIS IS RETURNING NOTHING TO THE VARIABLE!
MsgBox " OUTPUT : " & varAtts.Item(0).textString
'PCOUNT = PCOUNT + val(varAtts)
End If
End If
Next i