Author Topic: Determining if an xref is attached or overlayed  (Read 2170 times)

0 Members and 1 Guest are viewing this topic.

BAshworth

  • Guest
Determining if an xref is attached or overlayed
« on: June 19, 2007, 07:48:57 PM »
Again I find my self certain that this can't be this difficult to do.

Simply, how to determine if an xref is defined as attached or overlayed?

From my ruminations, it appears that lisp is only consistent solution.

Anyone have any hints on pulling this off that don't involve lisp?

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Determining if an xref is attached or overlayed
« Reply #1 on: June 19, 2007, 08:00:34 PM »
Ive done it, let me see if I can find that code tomorrow at work
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Determining if an xref is attached or overlayed
« Reply #2 on: June 20, 2007, 11:12:08 AM »
I cant find it, but Ill keep looking
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

deegeecees

  • Guest
Re: Determining if an xref is attached or overlayed
« Reply #3 on: June 20, 2007, 11:14:55 AM »
The "bOverlay" parameter in "AttachExternalReference" should get you there.

BAshworth

  • Guest
Re: Determining if an xref is attached or overlayed
« Reply #4 on: June 20, 2007, 11:16:44 AM »
The "bOverlay" parameter in "AttachExternalReference" should get you there.

That will allow me to add an xref as an attach or overlay, but not to query an existing xref.

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Determining if an xref is attached or overlayed
« Reply #5 on: June 20, 2007, 11:21:23 AM »
I tried adding a xref using bOverlay, and when I used the WhatAmI function, there was no information on overlay.  I think that was one of the properties that wasn't exposed to the dropdown, but could be used anyways.  I'll keep looking
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

deegeecees

  • Guest
Re: Determining if an xref is attached or overlayed
« Reply #6 on: June 20, 2007, 11:31:50 AM »
The "bOverlay" parameter in "AttachExternalReference" should get you there.

That will allow me to add an xref as an attach or overlay, but not to query an existing xref.

Yeah, sorry for the misinfo, I looked at it after I posted and thought "thats not right".

After searching, I can't seem to find anything either.

Chuck Gabriel

  • Guest
Re: Determining if an xref is attached or overlayed
« Reply #7 on: June 20, 2007, 11:46:37 AM »
If you can still get your hands on Frank Oquendo's vbXtender, and if it works with the version of AutoCAD you are using, it has a wrapper class for xrefs that exposes a property that distinguishes between attached and overlaid xrefs.

Another alternative is to use Frank's vlax class to call the required lisp code to accomplish this.

You can do this easily with .NET, or less easily (but still more directly) with ObjecARX.

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Determining if an xref is attached or overlayed
« Reply #8 on: June 20, 2007, 11:56:57 AM »
If you can still get your hands on Frank Oquendo's vbXtender
This must be what I was remembering.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second

BAshworth

  • Guest
Re: Determining if an xref is attached or overlayed
« Reply #9 on: June 20, 2007, 12:20:01 PM »
I tried adding a xref using bOverlay, and when I used the WhatAmI function, there was no information on overlay.  I think that was one of the properties that wasn't exposed to the dropdown, but could be used anyways.  I'll keep looking

It's determined by the value of DXF code 70 of the BLOCK instance of the xref (not INSERT).  However, I can't create a selection set of BLOCK definitions via VBA.

Gah!

deegeecees

  • Guest
Re: Determining if an xref is attached or overlayed
« Reply #10 on: June 20, 2007, 12:50:55 PM »

BAshworth

  • Guest
Re: Determining if an xref is attached or overlayed
« Reply #11 on: June 20, 2007, 01:04:14 PM »
If you can still get your hands on Frank Oquendo's vbXtender, and if it works with the version of AutoCAD you are using, it has a wrapper class for xrefs that exposes a property that distinguishes between attached and overlaid xrefs.

Another alternative is to use Frank's vlax class to call the required lisp code to accomplish this.

You can do this easily with .NET, or less easily (but still more directly) with ObjecARX.

I've come across posts of yours on other boards in regards to this.

I couldn't find a version of the compiled .arx file newer than 2002.

Found the source files though.

What would I need to compile this using the 2006 libraries so it would work with my version? (or is that even the best route to take?)

Chuck Gabriel

  • Guest
Re: Determining if an xref is attached or overlayed
« Reply #12 on: June 20, 2007, 01:15:23 PM »
What would I need to compile this using the 2006 libraries so it would work with my version? (or is that even the best route to take?)

I believe you would need VC++2002, which is fairly difficult to lay hands on these days (unless you have an MSDN subscription).  You might be able to find a copy on Ebay.  However, there are better (in my opinion) options.

Apparently, the DWGDirectX libraries, from the Open Design Alliance, expose the functionality you need, per the page DGC linked to.  If this is part of a larger project with much of the code already written, I would chose this option, though it does add a large dependency to your project.  However, if you plan to distribute the code outside of your organization, this option will most likely throw a monkey wrench in your plans.

The most direct and accessible route would be to switch to .NET, but I realize that might be a tall order if you already have a lot of code written.

Bryco

  • Water Moccasin
  • Posts: 1849
Re: Determining if an xref is attached or overlayed
« Reply #13 on: June 20, 2007, 05:46:41 PM »
The vbassoc function gives you the dxf 70 no problem, (Use it on the block not the blockreference) however you still have to subtract to find out if there is an 8 in there.
File dependencies may offer an indirect way to see if a drawing is attached.
I think there may be no actual difference between an xref that has no dependencies inserted as an overlay or an attachment. (Guessing I don't know).
If so you can test thisdrawings dependencies against the xrefs dependencies.
 

BAshworth

  • Guest
Re: Determining if an xref is attached or overlayed
« Reply #14 on: June 20, 2007, 07:44:03 PM »
The vbassoc function gives you the dxf 70 no problem, (Use it on the block not the blockreference) however you still have to subtract to find out if there is an 8 in there.
File dependencies may offer an indirect way to see if a drawing is attached.
I think there may be no actual difference between an xref that has no dependencies inserted as an overlay or an attachment. (Guessing I don't know).
If so you can test thisdrawings dependencies against the xrefs dependencies.
 

I'll play around with this next week. (vacation)

Now why didn't any of my earlier searches point me towards this thread.

Thanks a bunch bryco.  This was one of the three outstanding issues I was having with this macro.