ACAD 2006 - Dynamic Block Properties
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
ACAD 2006 - Dynamic Block Properties

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Colin French
Guest





Posted: Tue Mar 08, 2005 7:37 pm    Post subject: ACAD 2006 - Dynamic Block Properties Reply with 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
Ravi Pothineni
Guest





Posted: Sat Mar 12, 2005 4:24 am    Post subject: Re: ACAD 2006 - Dynamic Block Properties Reply with quote

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 Reply with quote

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 Reply with quote

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 Reply with quote

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
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB