Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
.NET
»
Topic:
Explode block with annotative state
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Explode block with annotative state (Read 1497 times)
0 Members and 1 Guest are viewing this topic.
latour_g
Newt
Posts: 184
Explode block with annotative state
«
on:
August 28, 2017, 04:01:29 PM »
Hi,
I need to explode a block that contains annotative objects. The problem I have is the annotative state get loose after the explode. Here is what I have :
Code - C#:
[Select]
DBObjectCollection coll
=
new
DBObjectCollection
(
)
;
br
.
Explode
(
coll
)
;
System.
Collections
.
IEnumerator
iter
=
coll
.
GetEnumerator
(
)
;
while
(
iter
.
MoveNext
(
)
)
{
Entity ent
=
(
Entity
)
iter
.
Current
;
ent
.
SetDatabaseDefaults
(
)
;
btr
.
AppendEntity
(
ent
)
;
tr
.
AddNewlyCreatedDBObject
(
ent,
true
)
;
}
br
.
Erase
(
)
;
coll
.
Dispose
(
)
;
When debugging, I see that "ent" has AnnotativeState at true.
Logged
Bryco
Water Moccasin
Posts: 1883
Re: Explode block with annotative state
«
Reply #1 on:
August 29, 2017, 12:06:20 AM »
That may involve deep clone. I clone objects and they do not copy the xdata so you may have the same problem.
basically you deep clone the objects from the block and transform them using the blockref.BlockTransform
Logged
latour_g
Newt
Posts: 184
Re: Explode block with annotative state
«
Reply #2 on:
August 30, 2017, 03:05:55 PM »
Thanks Bryco I'm gonna check this out
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
.NET
»
Topic:
Explode block with annotative state