mfleming
Structural
- Oct 24, 2004
- 64
Hello.
I'm working on an app that will take width & height values from an excel file and add them to the LOOKUP of my rectangle shape Dynamic Block.
In the end I want to be able to update my Dynamic Blocks in the drawing with the NEW LOOKUP values to Stretch the Width & Height.
My Dynamic Block:
PropertyName = "LabelHeight" & "LabelWidth"
Block Name = "DYN-Foam"
I can get the PropertyName and Value using "GetDynamicBlockProperties" and the ".PropertyName" & ".Value" but I cant seem to erase all of them and put in new ones.
STEP 1 - In the Dynamic Block Updating
Suggestions?
I'm working on an app that will take width & height values from an excel file and add them to the LOOKUP of my rectangle shape Dynamic Block.
In the end I want to be able to update my Dynamic Blocks in the drawing with the NEW LOOKUP values to Stretch the Width & Height.
My Dynamic Block:
PropertyName = "LabelHeight" & "LabelWidth"
Block Name = "DYN-Foam"
I can get the PropertyName and Value using "GetDynamicBlockProperties" and the ".PropertyName" & ".Value" but I cant seem to erase all of them and put in new ones.
STEP 1 - In the Dynamic Block Updating
Code:
Private Sub CommandButton4_Click()
Dim element As Object
Dim elementBlock As AcadBlockReference
Dim ArrayAttributes As Variant
Dim i As Integer
Dim pname As Variant
Dim lookuptbl As Variant
Dim width As Double
Dim height As Double
For Each elementBlock In ThisDrawing.ModelSpace
If elementBlock.IsDynamicBlock = True Then
lookuptbl = elementBlock.GetDynamicBlockProperties
'The stuff below is for reference only
ListBox1.AddItem pname
ListBox2.AddItem lookuptbl(4).PropertyName
ListBox2.AddItem lookuptbl(4).Value
'ListBox2 = lookuptbl(4).AllowedValues(1)
'I cant seem to get the AllowedValues but I can see them in the watch window.
ListBox2.AddItem " "
ListBox2.AddItem lookuptbl(5).PropertyName
ListBox2.AddItem lookuptbl(5).Value
ListBox2.AddItem " "
ListBox2.AddItem lookuptbl(0).PropertyName
ListBox2.AddItem lookuptbl(0).Value
End If
Next
End Sub
Suggestions?