Author Topic: Overlay Or Attached Block Reference  (Read 2960 times)

0 Members and 1 Guest are viewing this topic.

kwarmington

  • Guest
Overlay Or Attached Block Reference
« on: September 03, 2009, 09:20:34 PM »
How can I find out if a block has been overlayed or attached? It doesnt seem to be a property of the block Reference?

Cheers,

Kate

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Overlay Or Attached Block Reference
« Reply #1 on: September 03, 2009, 10:15:49 PM »

perhaps something like

if (btr.IsFromExternalReference || btr.IsFromOverlayReference)
{
   ed.WriteMessage("\nXref: true");
}
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Overlay Or Attached Block Reference
« Reply #2 on: September 03, 2009, 10:22:13 PM »
This may help ...


[Wrapper("AcDbBlockTableRecord")]
public class BlockTableRecord : SymbolTableRecord, IEnumerable
{
    // Fields
    private static BlockInsertionPointsEventHandler BlockInsertionPoints;
    private static BlockInsertionPointsEventHandler m_blockInsertionPoints;
    private bool m_bSkipDeleted;
    private static int m_nInsPtCount;
    public static string modopt(IsConst) modopt(IsConst) ModelSpace;
    public static string modopt(IsConst) modopt(IsConst) PaperSpace;

    // Events
    public static  event BlockInsertionPointsEventHandler BlockInsertionPoints;

    // Methods
    static BlockTableRecord();
    public BlockTableRecord();
    protected internal BlockTableRecord(IntPtr unmanagedPointer, [MarshalAs(UnmanagedType.U1)] bool autoDelete);
    public void {dtor}();
    public ObjectId AppendEntity(Entity entity);
    public void AssumeOwnershipOf(ObjectIdCollection entitiesToMove);
    protected internal virtual BlockTableRecord Copy();
    private static void DecrementInsPtHandlerCount();
    public ObjectIdCollection GetBlockReferenceIds([MarshalAs(UnmanagedType.U1)] bool directOnly, [MarshalAs(UnmanagedType.U1)] bool forceValidity);
    public BlockTableRecordEnumerator GetEnumerator();
    public ObjectIdCollection GetErasedBlockReferenceIds();
    internal unsafe AcDbBlockTableRecord* GetImpObj();
    public Database GetXrefDatabase([MarshalAs(UnmanagedType.U1)] bool incrementUnresolved);
    IEnumerator IEnumerable.GetEnumerator();
    private static void IncrementInsPtHandlerCount();

    // Properties
    public ObjectId BlockBeginId { get; }
    public ObjectId BlockEndId { get; }
    public BlockScaling BlockScaling { get; set; }
    public string Comments { get; set; }
    public ObjectId DrawOrderTableId { get; }
    public bool Explodable { [return: MarshalAs(UnmanagedType.U1)] get; [param: MarshalAs(UnmanagedType.U1)] set; }
    public bool HasAttributeDefinitions { [return: MarshalAs(UnmanagedType.U1)] get; }
    public bool HasPreviewIcon { [return: MarshalAs(UnmanagedType.U1)] get; }
    public BlockTableRecord IncludingErased { get; }
    public bool IsAnonymous { [return: MarshalAs(UnmanagedType.U1)] get; }
    public bool IsDynamicBlock { [return: MarshalAs(UnmanagedType.U1)] get; }
    public bool IsFromExternalReference { [return: MarshalAs(UnmanagedType.U1)] get; }
    public bool IsFromOverlayReference { [return: MarshalAs(UnmanagedType.U1)] get; }
    public bool IsLayout { [return: MarshalAs(UnmanagedType.U1)] get; }
    public bool IsUnloaded { [return: MarshalAs(UnmanagedType.U1)] get; [param: MarshalAs(UnmanagedType.U1)] set; }
    public ObjectId LayoutId { get; set; }
    public Point3d Origin { get; set; }
    public string PathName { get; set; }
    public Bitmap PreviewIcon { get; set; }
    protected internal bool SkipDeleted { [return: MarshalAs(UnmanagedType.U1)] get; }
    public UnitsValue Units { get; set; }
    public XrefStatus XrefStatus { get; }
}


public enum XrefStatus
{
    NotAnXref,
    Resolved,
    Unloaded,
    Unreferenced,
    FileNotFound,
    Unresolved
}




kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

kwarmington

  • Guest
Re: Overlay Or Attached Block Reference
« Reply #3 on: September 04, 2009, 12:07:49 AM »
Thanks everyone, that worked a treat :)


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Overlay Or Attached Block Reference
« Reply #4 on: September 04, 2009, 12:26:58 AM »
well, I'm not quite everyone Kate,  ... but you're welcome.  :)
« Last Edit: September 04, 2009, 12:42:23 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Overlay Or Attached Block Reference
« Reply #5 on: September 04, 2009, 07:41:29 PM »
Nice to see another Aussie here on the swamp.
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.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)