Results 1 to 5 of 5

Thread: ACAD 2006 - Dynamic Block Properties

  1. #1
    Colin French Guest

    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

  2. #2
    Ravi Pothineni Guest
    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@jiveforu m2.autodesk.com...
    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

  3. #3
    Colin French Guest
    Excellent! Thanks very much for the sample code, Ravi. Now I can start scheming about how to use them in our group.

    ...Colin French

  4. #4
    JMSchmidt Guest
    Is there a way to get the actions of a DynamicBlockProperty in a dynamic block too?

  5. #5
    Ravi Pothineni Guest
    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@jiveforu m2.autodesk.com...
    Is there a way to get the actions of a DynamicBlockProperty in a dynamic
    block too?

Similar Threads

  1. Dynamic Block artribute export
    By Ron Suarez in forum AutoCAD
    Replies: 0
    Last Post: 10-04-2010, 07:31 AM
  2. block instances and properties
    By blisspikle in forum SolidWorks
    Replies: 4
    Last Post: 08-04-2005, 09:10 AM
  3. Replies: 1
    Last Post: 05-06-2005, 05:10 PM
  4. Dynamic Block - LISP(vlax) editing
    By C Witt in forum Customization
    Replies: 0
    Last Post: 04-08-2005, 03:43 PM
  5. ACAD 2006 Dynamic Blocks Actions
    By JMSchmidt in forum VBA
    Replies: 0
    Last Post: 04-08-2005, 06:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum