Results 1 to 7 of 7

Thread: SCHEDULING ATTRIBUTES TOGETHER WITH DATA OF PROPERTY SETS

  1. #1
    Member
    Join Date
    2005-02
    Posts
    22
    Login to Give a bone
    0

    Default SCHEDULING ATTRIBUTES TOGETHER WITH DATA OF PROPERTY SETS

    David Koch latest tutorial on his blog brings up the idea of extracting Block Attributes data via a schedule tag(ADT 2007). Why : the scheduling tool in ADT is very handsome and Attributes permits me to use the flexibility of using formula's on dynamic block sub elements and all this with a little of programming and great flexibility.

    Items in the schedule tag :
    - Object ID,
    - A formula :

    Set acadApp = GetObject(,"AutoCAD.Application")
    Set blockObj = acadApp.ActiveDocument.ObjectIDToObject([ObjectID])
    Attributen=blockObj.GetAttributes()
    Set L=Attributen(0).textString
    RESULT = L

    But without success. A check learns me that the "Attributen" aren't empty. But extracting data from the array is without success. Any help would be great and help me a lot.
    A sample file with my trials is joined.

    This method let you combine the best of attributes and scheduling.

    Sincerely yours and thanks in advance.

    Jo

    (This Thread was also published in ADT 2007)

  2. #2
    All AUGI, all the time zoomharis's Avatar
    Join Date
    2005-02
    Location
    Abu Dhabi (Native-India)
    Posts
    506
    Login to Give a bone
    0

    Default Re: SCHEDULING ATTRIBUTES TOGETHER WITH DATA OF PROPERTY SETS

    Quote Originally Posted by jo.moens
    David Koch latest tutorial on his blog brings up the idea of extracting Block Attributes data via a schedule tag(ADT 2007). Why : the scheduling tool in ADT is very handsome and Attributes permits me to use the flexibility of using formula's on dynamic block sub elements and all this with a little of programming and great flexibility.

    Items in the schedule tag :
    - Object ID,
    - A formula :

    Set acadApp = GetObject(,"AutoCAD.Application")
    Set blockObj = acadApp.ActiveDocument.ObjectIDToObject([ObjectID])
    Attributen=blockObj.GetAttributes()
    Set L=Attributen(0).textString
    RESULT = L

    But without success. A check learns me that the "Attributen" aren't empty. But extracting data from the array is without success. Any help would be great and help me a lot.
    A sample file with my trials is joined.

    This method let you combine the best of attributes and scheduling.

    Sincerely yours and thanks in advance.

    Jo

    (This Thread was also published in ADT 2007)
    Hi Jo,
    Don't know anything about ADT or Scheduling. But I think you can not use Set statement for assigning a text string. It's only used with objects.

  3. #3
    Member
    Join Date
    2005-02
    Posts
    22
    Login to Give a bone
    0

    Default Re: SCHEDULING ATTRIBUTES TOGETHER WITH DATA OF PROPERTY SETS

    Thanks for the reply.

    Your right. Removed the Set statement, but the result stays the same.

    Jo

  4. #4
    Member Apsis0215's Avatar
    Join Date
    2002-01
    Location
    Apopka, FL
    Posts
    43
    Login to Give a bone
    0

    Post Re: SCHEDULING ATTRIBUTES TOGETHER WITH DATA OF PROPERTY SETS

    Quote Originally Posted by jo.moens
    Thanks for the reply.

    Your right. Removed the Set statement, but the result stays the same.

    Jo
    Any progress or possible solutions oin this one?

  5. #5
    Woo! Hoo! my 1st post
    Join Date
    2006-08
    Posts
    1
    Login to Give a bone
    0

    Default Re: SCHEDULING ATTRIBUTES TOGETHER WITH DATA OF PROPERTY SETS

    Code:
    Sub BlockAttributes()
    
    Dim DXFcode(0) As Integer
    Dim DXFdata(0) As Variant
    Dim Blocks As AcadSelectionSet
    Dim Block As AcadBlockReference
    Dim Attributes As Variant
    Dim Attribute_() As AcadAttributeReference
    Dim Tag As String
    Dim Text As String
    
    Set Selections = ThisDrawing.SelectionSets
    
    On Error Resume Next
    Set Blocks = Selections.Add("Collection")
    If Err Then
        Set Blocks = Selections.Item("Collection")
        Blocks.Clear
        Err.Clear
    End If
    
    On Error GoTo 0
    
    DXFcode(0) = "0"
    DXFdata(0) = "INSERT"
    
    Call Blocks.Select(acSelectionSetAll, , , DXFcode, DXFdata)
    
    For Each Block In Blocks
        
        If Block.HasAttributes = True Then
        
            Attributes = Block.GetAttributes
            
            ReDim Attribute_(0 To UBound(Attributes))
            
            For i = LBound(Attributes) To UBound(Attributes)
            
                Set Attribute_(i) = Attributes(i)
                
                Tag = Attribute_(i).TagString
                Text = Attribute_(i).TextString
                
                Select Case MsgBox("Change attribute value: " & Tag, vbYesNo, "Change attribute value")
                
        
                    Case vbYes
                    
                        Dim NewText As String
                    
                        NewText = InputBox("Enter new attribute value: ", "New attribute value")
            
                        Attribute_(i).TextString = NewText
                     
                    Case vbNo
                     
                        Resume Next
                     
                End Select
    
            Next i
        
        End If
    
    Next Block
        
    End Sub
    [ Moderator Action = ON ] What are [CODE] tags? [ Moderator Action = OFF ]
    Last edited by Opie; 2006-08-18 at 02:10 PM. Reason: [CODE] tags added, see moderator comment

  6. #6
    Member Apsis0215's Avatar
    Join Date
    2002-01
    Location
    Apopka, FL
    Posts
    43
    Login to Give a bone
    0

    Default Re: SCHEDULING ATTRIBUTES TOGETHER WITH DATA OF PROPERTY SETS

    HMMM...

    Not what I was looking for .. I want to link the dynamic element properties into useable properties I can schedule and tag.

  7. #7
    Member Apsis0215's Avatar
    Join Date
    2002-01
    Location
    Apopka, FL
    Posts
    43
    Login to Give a bone
    0

    Smile Re: SCHEDULING ATTRIBUTES TOGETHER WITH DATA OF PROPERTY SETS

    Quote Originally Posted by Aphelion
    HMMM...

    Not what I was looking for .. I want to link the dynamic element properties into useable properties I can schedule and tag.
    HOWEVER... : )

    I can dissect and recycle this to my next greatest aspiration... tieing attributes into the properties VIA some behind the scenes magic and a few strategic calls here and there : )

    TTFN!

Similar Threads

  1. 2015: Property Sets
    By arminm1988414598 in forum ACA General
    Replies: 0
    Last Post: 2015-05-28, 12:44 PM
  2. 2011: Property Data Sets
    By Chuckyd67 in forum ACA General
    Replies: 5
    Last Post: 2011-06-02, 02:14 AM
  3. Replies: 8
    Last Post: 2006-06-27, 04:30 PM
  4. Property Data Sets - Object Overrides
    By welk3d-cad1 in forum ACA Wish List
    Replies: 0
    Last Post: 2004-12-23, 03:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •