I can insert it as XRef in a new drawing. To recover the drawing, I would
like to copy all the entities from the XRef to the empty modelspace.
I use this code :
Sub xrefcopy()
Dim objSS As AcadSelectionSet
Dim entity As AcadEntity
Dim xref As AcadBlock
Dim NewEntity As AcadEntity
Set objSS = ThisDrawing.SelectionSets.Add("all")
objSS.Select acSelectionSetAll
For Each entity In objSS
If entity.ObjectName = "AcDbBlockReference" Then
Set xref = ThisDrawing.Blocks(entity.Name)
End If
Next entity
For Each entity In xref
Set NewEntity = entity.Copy
NewEntity.Layer = "0"
Next entity
If Not objSS Is Nothing Then
objSS.Delete
End If
ThisDrawing.Regen acAllViewports
End Sub
It works... But not as I would like... Every entity is copied, but INSIDE
the XRef !
When I remove it, nothing stays on the screen. So it doesn't help me...
I've thought it was maybe because I send the entities on the "0" layer. But
it doesn't work. If I try to send an entity on a new layer from the
modelspace, it makes an error;
What can I do? Thanks for your help...
Alexis Perdaen
AM4D
Brussels, Belgium
Brian D.
"AM4D" <alexis....@skynet.be> wrote in message
news:0F35880CC092449B...@in.WebX.maYIadrTaRb...
You maybe have another idea...
Thanks
"Brian D." <bcd...@hiwaay.com.{Remove-This-To-Reply}> a écrit dans le
message de news: E08B61FAEFFCB9D9...@in.WebX.maYIadrTaRb...
I have already tried it... with the same problem. The copied object stays
inside of the XRef...
"Bobby C. Jones" <bob...@acadx.com> a écrit dans le message de news:
f0d6...@WebX.maYIadrTaRb...
An Xref is a block insert. Find the block record in the blocks collection,
then take the XRefDatabase property from it. Dig through it for your
entities.
Brian D.
"AM4D" <alexis....@skynet.be> wrote in message
news:229CCB5701DC1260...@in.WebX.maYIadrTaRb...
"AM4D" <alexis....@skynet.be> wrote in message
news:D83780435F48FB73...@in.WebX.maYIadrTaRb...
If the above trials are unsuccessful then you can try using the partial open
command to read in a layer at a time. You will probably read in one or two
layers that cause the problem again. Just avoid those layers when doing the
partial open (the next time) and SaveAs the drawing to another name after
you have as much as you can salvage.
HTH, Andy