GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoDocument Class / AddCopy Method
In This Topic
    AddCopy Method
    In This Topic
    Add a copy of an object into this document at the given point.
    Syntax
    public GoObject AddCopy( 
       GoObject obj,
       PointF loc
    )

    Parameters

    obj
    loc

    Return Value

    The newly inserted object.
    Remarks

    This creates a singleton collection and calls CopyFromCollection(IGoCollection,Boolean,Boolean,SizeF,GoCopyDictionary) with the appropriate offset. This method is different from Add in that the latter method causes the document to own the object; i.e., the object's GoObject.Layer property is modified to be this document's default layer. But this method does not modify the obj and may add the copy to a different layer, if obj belongs to a layer and CopyFromCollection can find a matching layer in this document.

    If you want to make a copy of a GoObject but do not want to add it to a document, you can call GoCopyDictionary.CopyComplete or GoObject.GoObject.Copy.

    See Also