TheSwamp

Code Red => VB(A) => Topic started by: cadpro on November 07, 2006, 06:30:35 AM

Title: Attribute from xref
Post by: cadpro on November 07, 2006, 06:30:35 AM
Hi all,

Is it possible to retrieve the attribute values from an xref using objectDBX?

Thanks
Title: Re: Attribute from xref
Post by: Glenn R on November 07, 2006, 06:56:20 AM
Yes
Title: Re: Attribute from xref
Post by: cadpro on November 07, 2006, 07:44:57 AM
Could you please help me out on how to do this?

Thanks
Title: Re: Attribute from xref
Post by: Bryco on November 07, 2006, 10:06:39 AM
There is no selectionset available so you must cycle through model or paperspace.
So are you trying to get every att from every blockref or ??.
Let's narrow it down a bit.
Title: Re: Attribute from xref
Post by: cadpro on November 08, 2006, 12:57:08 AM
Thanks for the reply Bryco.

I search every layout specifically, as each layout contains some blockreferences that has a few attributes. What I intend to do is, I write these attributes into Excel, one row for one layout. And so far, everything works. But one of the attributes are in an xref which cannot be retrieved like all other attributes. So I would like to know how this can be done.

Thanks
Title: Re: Attribute from xref
Post by: cadpro on November 08, 2006, 02:54:18 AM
This is my code:

Code: [Select]
For intLayout = objDBX.Layouts.Count - 1 To 0 Step -1
   If objDBX.Layouts(intLayout).ModelType = False Then
      For Each objEnt In objDBX.Layouts(intLayout).Block
         If TypeOf objEnt Is AcadExternalReference Then
            For Each Entity In objDBX.Layouts(intLayout).Block(objEnt.Name)
               If Entity.HasAttributes Then
                  'do operation here
               End If
           Next Entity
         End If
      Next objEnt
   End If
Next intLayout

Thanks
Title: Re: Attribute from xref
Post by: Glenn R on November 08, 2006, 05:15:18 AM
Could you please help me out on how to do this?

I don't feel inclined to do so
Title: Re: Attribute from xref
Post by: Bryco on November 08, 2006, 11:57:31 PM
Since .XRefDatabase doesn't work with dbx you are best off opening up the xref with another instance of dbx and getting what you need
Title: Re: Attribute from xref
Post by: cadpro on November 11, 2006, 12:41:24 AM
Thanks Bryco. That worked. But it takes a while to execute the code. Is there some kind of code that executes faster?

Thanks
Title: Re: Attribute from xref
Post by: Kerry on November 11, 2006, 01:06:53 AM
Thanks Bryco. That worked. But it takes a while to execute the code. Is there some kind of code that executes faster?

Thanks

what worked. .. faster than what ??