| Author |
Message |
Colin French
Guest
|
Posted:
Tue Mar 08, 2005 7:37 pm Post subject:
ACAD 2006 - Dynamic Block Properties |
|
|
For those using the ACAD 2006 Beta, and have been allowed to post some sneak preview info - can you programatically access properties of Dynamic Blocks? E.g. if the user streches that boardroom table block from 8 feet to 12 feet, can I access a property that tells me the current length? Or the number of chairs it now has around it? (So our automated take-offs which form the basis of an order to the furniture supplier will come out right.)
Inquiring minds want to start musing over the possibilites... <grin>
...Colin French
|
|
| Back to top |
|
 |
Ravi Pothineni
Guest
|
Posted:
Sat Mar 12, 2005 4:24 am Post subject:
Re: ACAD 2006 - Dynamic Block Properties |
|
|
Yes, you can. Here is some code to get you started.
Sub test()
'Documents.Open "C:\Program Files\AutoCAD 2006\Sample\Blocks and
Tables - Imperial.dwg"
Dim ent As AcadEntity
For Each ent In ThisDrawing.ModelSpace
If ent.ObjectName = "AcDbBlockReference" Then
Dim oBkRef As IAcadBlockReference2
Set oBkRef = ent
If oBkRef.IsDynamicBlock = True Then
Dim v As Variant
v = oBkRef.GetDynamicBlockProperties
Dim i As Long
For i = LBound(v) To UBound(v)
Dim oDynProp As AcadDynamicBlockReferenceProperty
Set oDynProp = v(i)
Debug.Print oDynProp.PropertyName
If IsArray(oDynProp.Value) Then
Dim j As Long
For j = LBound(oDynProp.Value) To
UBound(oDynProp.Value)
Debug.Print oDynProp.Value(j)
Next j
Else
Debug.Print oDynProp.Value
End If
Next
End If
End If
Next ent
End Sub
"Colin French" <nospam@address.withheld> wrote in message
news:19393175.1110292687402.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | For those using the ACAD 2006 Beta, and have been allowed to post some
sneak preview info - can you programatically access properties of Dynamic
Blocks? E.g. if the user streches that boardroom table block from 8 feet
to 12 feet, can I access a property that tells me the current length? Or
the number of chairs it now has around it? (So our automated take-offs
which form the basis of an order to the furniture supplier will come out
right.)
Inquiring minds want to start musing over the possibilites... <grin
..Colin French |
|
|
| Back to top |
|
 |
Colin French
Guest
|
Posted:
Mon Mar 14, 2005 8:16 pm Post subject:
Re: ACAD 2006 - Dynamic Block Properties |
|
|
Excellent! Thanks very much for the sample code, Ravi. Now I can start scheming about how to use them in our group.
...Colin French
|
|
| Back to top |
|
 |
JMSchmidt
Guest
|
Posted:
Thu Apr 07, 2005 8:07 pm Post subject:
Re: ACAD 2006 - Dynamic Block Properties |
|
|
| Is there a way to get the actions of a DynamicBlockProperty in a dynamic block too? |
|
| Back to top |
|
 |
Ravi Pothineni
Guest
|
Posted:
Sat Apr 09, 2005 2:34 am Post subject:
Re: ACAD 2006 - Dynamic Block Properties |
|
|
What do you mean by "get the actions of a DynamicBlockProperty"? If you want
to modify the block definition then you are out of luck.
You can only set/get per instance property values of dynamic blocks.
"JMSchmidt" <nospam@address.withheld> wrote in message
news:17621384.1112890105929.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | Is there a way to get the actions of a DynamicBlockProperty in a dynamic
block too? |
|
|
| Back to top |
|
 |
|
|
|
|