Problem displaying vlaues

Problem displaying vlaues

Anonymous
Not applicable
386 Views
3 Replies
Message 1 of 4

Problem displaying vlaues

Anonymous
Not applicable
I am trying to write a simple macro to display the property name and the value of the dynamic blocks in my drawing. If the dynamic block property is a single number, it works fine. However, if the property returns a point with value(0), (1) and (2), I can't get it to display. Below is the code.

Sub test()
Dim myEnt As AcadEntity
Dim MyBlkRef As AcadBlockReference
For Each myEnt In ThisDrawing.ModelSpace
Select Case myEnt.ObjectName
Case "AcDbBlockReference"
Set MyBlkRef = myEnt
If MyBlkRef.HasAttributes Then
atts = MyBlkRef.GetDynamicBlockProperties
Dim I As Long
For I = LBound(atts) To UBound(atts)
Dim eric1 As VbVarType
eric1 = vartype(atts(I).Value)
If eric1 = vbArray + vbDouble Then
MsgBox atts(I).PropertyName & " = " & atts(I).Value(0)
Else
MsgBox atts(I).PropertyName & " = " & atts(I).Value
End If
Next I
End If
End Select
Next
End Sub

Any Ideas? Message was edited by: conveyor1
0 Likes
387 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
wrote in message news:[email protected]...
I am trying to write a simple macro to display the property name and the
value of the dynamic blocks in my drawing. If the dynamic block property is
a single number, it works fine. However, if the property returns a point
with value(0), (1) and (2), I can't get it to display. Below is the code.

have you confirmed that this test accurately tests for an array(variant
containing array of doubles)
If eric1 = vbArray + vbDouble Then


aside from that...if you do get a point(variant containing array), set it to
a variable
varPt = atts(I).Value
then print the elements
str = varPt(0) & ", " & varPt(1) & ", " & varPt(2)
or similar...
I don't know why but have found that the property itself won't work without
putting in a variable first


hth
mark
0 Likes
Message 3 of 4

Anonymous
Not applicable
It worked. Thank You
0 Likes
Message 4 of 4

Anonymous
Not applicable
wrote in message news:[email protected]...
It worked. Thank You

yer welcome, glad to help
mark
0 Likes