Author Topic: Underlay loaded?  (Read 2406 times)

0 Members and 1 Guest are viewing this topic.

Joe Burke

  • Guest
Underlay loaded?
« on: May 05, 2011, 06:23:49 AM »
I'm looking for a way to determine whether an underlay reference (PDF, DWF or DGN) is loaded or not.

I hope it can be done. My efforts so far, using 2008, have failed.

TIA for any assistance.
« Last Edit: May 05, 2011, 06:32:43 AM by Joe Burke »

VVA

  • Newt
  • Posts: 166
Re: Underlay loaded?
« Reply #1 on: May 05, 2011, 07:26:50 AM »
removed
« Last Edit: May 05, 2011, 11:10:11 AM by VVA »

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Underlay loaded?
« Reply #2 on: May 05, 2011, 10:06:12 AM »
Could you provide an example Joe?  I haven't had any need, so I don't know off hand, but with an example we call can play.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Joe Burke

  • Guest
Re: Underlay loaded?
« Reply #3 on: May 05, 2011, 10:52:55 AM »
Could you provide an example Joe?  I haven't had any need, so I don't know off hand, but with an example we call can play.

Hi Tim,

Here's an example DWF file from the 2008 Help folder.

This returns a selection set of DWF references (ssget "x" '((0 . "DWFUNDERLAY"))). Likewise "PDFUNDERLAY" for PDF files and "DGNUNDERLAY" for Microstation DGN references.

Within Developer Help > DXF Reference > Entities Section check the UNDERLAY object type.
« Last Edit: May 05, 2011, 11:02:22 AM by Joe Burke »

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Underlay loaded?
« Reply #4 on: May 05, 2011, 11:06:57 AM »
Looks like for DGN files and DWF files, there is an XData item if the item is not to be loaded.  Don't know about the PDF, as I couldn't figure out how to load one.

Get the ' namedobjdict '.

Then for DGN files, look for ' ACAD_DGNDEFINITIONS '
for DWG files, look for ' ACAD_DWFDEFINITIONS '
within the NOD.

Then each item, code 350, will be the definition.

If there is an XData entry of
(-3 ((ACAD (1000 . "NOLOAD"))))
then it will not load, otherwise it is loaded.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Joe Burke

  • Guest
Re: Underlay loaded?
« Reply #5 on: May 05, 2011, 01:14:44 PM »
Looks like for DGN files and DWF files, there is an XData item if the item is not to be loaded.  Don't know about the PDF, as I couldn't figure out how to load one.

Get the ' namedobjdict '.

Then for DGN files, look for ' ACAD_DGNDEFINITIONS '
for DWG files, look for ' ACAD_DWFDEFINITIONS '
within the NOD.

Then each item, code 350, will be the definition.

If there is an XData entry of
(-3 ((ACAD (1000 . "NOLOAD"))))
then it will not load, otherwise it is loaded.

Many thanks, Tim. That sounds like a reliable method. I won't have time to test it until this evening.

After my post I also noticed this. Given a DWF underlay, the ActiveX Height and Width properties return a numeric value when the file is loaded. They toss an exception when the underlay is unloaded. At least true in 2008. I haven't tested in 2010 yet.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Underlay loaded?
« Reply #6 on: May 05, 2011, 01:26:36 PM »
You're welcome Joe.  I rather not go the exception route if a reliable way could be had.

I used the code posted in this thread to step through items.  It helped find this item.  Maybe it could help you also.
[ http://www.theswamp.org/index.php?topic=37979.msg429968#msg429968 ]
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Joe Burke

  • Guest
Re: Underlay loaded?
« Reply #7 on: May 06, 2011, 04:49:17 AM »
Tim,

This (-3 ("ACAD" (1000 . "NOLOAD"))) works very nice.

Thanks again.