Author Topic: Determine XrefStatus.Unreferenced  (Read 3107 times)

0 Members and 1 Guest are viewing this topic.

TJK44

  • Guest
Determine XrefStatus.Unreferenced
« on: August 12, 2013, 10:59:06 AM »
Has anyone else had issues with the XRefStatus either for a BlockTableRecord or XRefGraphNode returning resolved even if the status is Unreferenced in the XRef Manager window? Is it possible to tell if an XRef is Unreferenced, I want to loop through the XRefGraph ignoring Unreferenced Xrefs.

Thanks,

-Ted
« Last Edit: August 12, 2013, 11:06:31 AM by TJK44 »

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Determine XrefStatus.Unreferenced
« Reply #1 on: August 12, 2013, 06:57:33 PM »
Unreferenced, or unloaded?
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

TJK44

  • Guest
Re: Determine XrefStatus.Unreferenced
« Reply #2 on: August 13, 2013, 08:08:50 AM »
Unreferenced, this happens when they delete an xref in the drawing and then the status changes to unreferenced. Looping through the xref graph these unreferenced xrefs give a status of resolved?

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Determine XrefStatus.Unreferenced
« Reply #3 on: August 13, 2013, 10:18:37 AM »
Are you using Database.ResolveXrefs Method before obtaining the XrefGraph?

TJK44

  • Guest
Re: Determine XrefStatus.Unreferenced
« Reply #4 on: August 13, 2013, 10:46:28 AM »
I just tried ResolveXRefs but same result, XRefStatus is still Resolved if it has a status of Unreferenced in xref manager.

I checked the XrefStatus of the XrefGraphNode as well as the BlockTableRecord for the xref and both values are resolved for unreferenced xrefs.
« Last Edit: August 13, 2013, 10:57:58 AM by TJK44 »

owenwengerd

  • Bull Frog
  • Posts: 451
Re: Determine XrefStatus.Unreferenced
« Reply #5 on: August 13, 2013, 10:58:41 AM »
Unresolved/Resolved and Referenced/Unreferenced are completely unrelated properties of an xref, so perhaps it would help to explain why you think there should be a connection.

TJK44

  • Guest
Re: Determine XrefStatus.Unreferenced
« Reply #6 on: August 13, 2013, 11:04:49 AM »
I want to be able to determine if the xref doesn't exist in the drawing anymore, but it may still reside in the xrefgraph. I thought looping through the xrefgraph and checking the xrefstatus would get me what I need.

Confusing because the xref manager status says unreferenced, but when debugging, XrefGraphNode.XrefStatus is always resolved.
« Last Edit: August 13, 2013, 11:08:37 AM by TJK44 »

owenwengerd

  • Bull Frog
  • Posts: 451
Re: Determine XrefStatus.Unreferenced
« Reply #7 on: August 13, 2013, 11:13:17 AM »
Confusing because the xref manager status says unreferenced, but when debugging, XrefGraphNode.XrefStatus is always resolved.

Resolved means the file is found; it has nothing to do with whether it is referenced in the drawing file. You should be able to call the xref's BlockTableRecord::GetBlockReferenceIds() to find out how many references there are.

TJK44

  • Guest
Re: Determine XrefStatus.Unreferenced
« Reply #8 on: August 13, 2013, 03:28:41 PM »
Thanks Owen, that worked.

I first purge the blocks and then check if btr.GetBlockReferenceIDs(True,True).Count > 0