Community
{
}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Roland Feletic" <feletic_at_pauser_dot_at> wrote in message
href="news:6074184@discussion.autodesk.com">news:6074184@discussion.autodesk.com...
I want to make a copy of
some BlockReferences, they can be dynamic therefor I have to
use DeepClone. When I try it with something like the following code
nothing happens. I think the problem is the currSpace. What should be instead
for the ownerPointer?
{code}
DBObject
tmpOriginalEntity = (Entity
size=2>)myT.GetObject(objId,
size=2>OpenMode.ForWrite);
BlockReference
tmpOriginalBlock = tmpOriginalEntity
size=2>as
size=2>BlockReference;
size=2>
if (tmpOriginalBlock
!= null)
{
IdMapping
size=2> idMap = new
IdMapping
size=2>();
DBObject
size=2> currSpace = (DBObject
size=2>)myT.GetObject(db.CurrentSpaceId,
size=2>OpenMode.ForWrite);
DBObject
size=2> tmpnewBlockRef = tmpOriginalBlock.DeepClone(currSpace, idMap,
false);
}
size=2>{code}
entityCollection.Add(objId);
db.DeepCloneObjects(entityCollection, db.CurrentSpaceId,
idMap,
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Tony Tanzillo" <
title="mailto:tony.tanzillo@THE_URL_BELOW.com STRG + Klicken, um Verknüpfung zu folgen"
href="...>
schrieb im Newsbeitrag
href="news:6074499@discussion.autodesk.com">news:6074499@discussion.autodesk.com...
You dont call DeepClone on a DBObject, you call
the
DeepCloneObjects method of the Database.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009
href="http://www.acadxtabs.com">http://www.acadxtabs.com
Introducing AcadXTabs 2010:
title="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm STRG + Klicken, um Verknüpfung zu folg...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Roland Feletic" <feletic_at_pauser_dot_at> wrote in message
href="news:6074184@discussion.autodesk.com">news:6074184@discussion.autodesk.com...
I want to make a copy of
some BlockReferences, they can be dynamic therefor I have to
use DeepClone. When I try it with something like the following code
nothing happens. I think the problem is the currSpace. What should be
instead for the ownerPointer?
{code}
DBObject
tmpOriginalEntity = (Entity
size=2>)myT.GetObject(objId,
size=2>OpenMode.ForWrite);
BlockReference
tmpOriginalBlock = tmpOriginalEntity
size=2>as
size=2>BlockReference;
size=2>
if
(tmpOriginalBlock != null
size=2>)
{
IdMapping idMap =
size=2>new
size=2>IdMapping();
DBObject
size=2> currSpace = (DBObject
size=2>)myT.GetObject(db.CurrentSpaceId,
size=2>OpenMode.ForWrite);
DBObject
size=2> tmpnewBlockRef = tmpOriginalBlock.DeepClone(currSpace, idMap,
false);
}
size=2>{code}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Roland Feletic" <feletic_at_pauser_dot_at> wrote in message
href="news:6074895@discussion.autodesk.com">news:6074895@discussion.autodesk.com...
Thank you, Tony.
Now I did it like the following code and it
works. But may I ask you one question. When do I use DeepClone?
IdMapping
size=2> idMap = new
IdMapping
face=Arial>();
size=2>ObjectIdCollection entityCollection =
color=#0000ff size=2>new
size=2>ObjectIdCollection
face=Arial>();
entityCollection.Add(objId);
db.DeepCloneObjects(entityCollection, db.CurrentSpaceId,
idMap,
size=2>false);
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Tony Tanzillo" <
title="mailto:tony.tanzillo@THE_URL_BELOW.com STRG + Klicken, um Verknüpfung zu folgen"
hr...>
schrieb im Newsbeitrag
href="news:6074499@discussion.autodesk.com">news:6074499@discussion.autodesk.com...
You dont call DeepClone on a DBObject, you call
the
DeepCloneObjects method of the Database.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD
2000 through 2009
href="http://www.acadxtabs.com">http://www.acadxtabs.com
Introducing AcadXTabs 2010:
title="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm STRG + Klicken, um Verknüpfung zu fo...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Roland Feletic" <feletic_at_pauser_dot_at> wrote in message
href="news:6074184@discussion.autodesk.com">news:6074184@discussion.autodesk.com...
I want to make a copy of
some BlockReferences, they can be dynamic therefor I
have to use DeepClone. When I try it with something like the
following code nothing happens. I think the problem is the currSpace. What
should be instead for the ownerPointer?
{code}
DBObject
tmpOriginalEntity = (Entity
size=2>)myT.GetObject(objId,
size=2>OpenMode.ForWrite);
BlockReference
tmpOriginalBlock = tmpOriginalEntity
size=2>as
size=2>BlockReference;
size=2>
if
(tmpOriginalBlock != null
size=2>)
{
IdMapping idMap =
size=2>new
size=2>IdMapping();
DBObject currSpace = (
size=2>DBObject)myT.GetObject(db.CurrentSpaceId,
OpenMode
size=2>.ForWrite);
DBObject tmpnewBlockRef =
tmpOriginalBlock.DeepClone(currSpace, idMap,
size=2>false);
}
size=2>{code}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Tony Tanzillo" <
title="mailto:tony.tanzillo@THE_URL_BELOW.com STRG + Klicken, um Verknüpfung zu folgen"
href="...>
schrieb im Newsbeitrag
href="news:6075912@discussion.autodesk.com">news:6075912@discussion.autodesk.com...
You don't use DeepClone().
The DeepCloneObjects() method calls it (or its native
counterpart)
as part of the cloning process.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009
href="http://www.acadxtabs.com">http://www.acadxtabs.com
Introducing AcadXTabs 2010:
href="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm">http://www.caddzone.com/acadxtabs/Acad...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Roland Feletic" <feletic_at_pauser_dot_at> wrote in message
href="news:6074895@discussion.autodesk.com">news:6074895@discussion.autodesk.com...
Thank you, Tony.
Now I did it like the following code and it
works. But may I ask you one question. When do I use DeepClone?
IdMapping
size=2> idMap = new
IdMapping
face=Arial>();
size=2>ObjectIdCollection entityCollection =
new
color=#2b91af size=2>ObjectIdCollection
face=Arial>();
entityCollection.Add(objId);
db.DeepCloneObjects(entityCollection, db.CurrentSpaceId,
idMap,
size=2>false);
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Tony Tanzillo" <
title="mailto:tony.tanzillo@THE_URL_BELOW.com STRG + Klicken, um Verknüpfung zu folgen"
...>
schrieb im Newsbeitrag
href="news:6074499@discussion.autodesk.com">news:6074499@discussion.autodesk.com...
You dont call DeepClone on a DBObject, you call
the
DeepCloneObjects method of the Database.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD
2000 through 2009
href="http://www.acadxtabs.com">http://www.acadxtabs.com
Introducing AcadXTabs 2010:
title="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm STRG + Klicken, um Verknüpfung zu ...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Roland Feletic" <feletic_at_pauser_dot_at> wrote in message
href="news:6074184@discussion.autodesk.com">news:6074184@discussion.autodesk.com...
I want to make a copy of
some BlockReferences, they can be dynamic therefor I
have to use DeepClone. When I try it with something like the
following code nothing happens. I think the problem is the currSpace.
What should be instead for the ownerPointer?
{code}
DBObject
tmpOriginalEntity = (
size=2>Entity)myT.GetObject(objId,
color=#2b91af size=2>OpenMode.ForWrite);
BlockReference
tmpOriginalBlock = tmpOriginalEntity
size=2>as
size=2>BlockReference;
size=2>
if
(tmpOriginalBlock != null
size=2>)
{
IdMapping idMap =
size=2>new
size=2>IdMapping();
DBObject currSpace = (
size=2>DBObject)myT.GetObject(db.CurrentSpaceId,
OpenMode
size=2>.ForWrite);
DBObject tmpnewBlockRef =
tmpOriginalBlock.DeepClone(currSpace, idMap,
size=2>false);
}
size=2>{code}
Can't find what you're looking for? Ask the community or share your knowledge.