Author Topic: Attribute from xref  (Read 2403 times)

0 Members and 1 Guest are viewing this topic.

cadpro

  • Guest
Attribute from xref
« on: November 07, 2006, 06:30:35 AM »
Hi all,

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

Thanks

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Attribute from xref
« Reply #1 on: November 07, 2006, 06:56:20 AM »
Yes
Me

cadpro

  • Guest
Re: Attribute from xref
« Reply #2 on: November 07, 2006, 07:44:57 AM »
Could you please help me out on how to do this?

Thanks

Bryco

  • Water Moccasin
  • Posts: 1864
Re: Attribute from xref
« Reply #3 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.

cadpro

  • Guest
Re: Attribute from xref
« Reply #4 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

cadpro

  • Guest
Re: Attribute from xref
« Reply #5 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

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Attribute from xref
« Reply #6 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
Me

Bryco

  • Water Moccasin
  • Posts: 1864
Re: Attribute from xref
« Reply #7 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

cadpro

  • Guest
Re: Attribute from xref
« Reply #8 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

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Attribute from xref
« Reply #9 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 ??
 
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--