.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to retain draworder with copy-command

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
nijhuis
518 Views, 2 Replies

How to retain draworder with copy-command

Hello,

 

With the code below the draworder is not retained ,

does anynone knows how to retain the draworder in a .net copy command?

 

 

    Function MaakKopie(ByVal objIds As ObjectIdCollection) As ObjectIdCollection
        MaakKopie = New ObjectIdCollection

        Dim doc = Application.DocumentManager.MdiActiveDocument
        Dim dwg = doc.Database

        Using doc.lockdocument
            Using transactie = doc.TransactionManager.StartTransaction()
                Try

                    Dim s As BlockTableRecord
                    s = transactie.GetObject(dwg.CurrentSpaceId, OpenMode.ForWrite)

                    For Each objId In objIds
                        Dim Element As Entity
                        Element = transactie.GetObject(objId, OpenMode.ForWrite)

                        Dim Kopie = Element.Clone
                        Dim id = s.AppendEntity(Kopie)

                        transactie.AddNewlyCreatedDBObject(Kopie, True)

                        MaakKopie.Add(id)

                    Next


                    transactie.Commit()
                Catch ex As Exception
                    MsgBox("Er ging iets fout: " & vbCrLf & ex.Message)
                    MaakKopie = Nothing
                End Try
            End Using
        End Using
    End Function

 

Regards,

 

 

 

2 REPLIES 2
Message 2 of 3
augusto.goncalves
in reply to: nijhuis

Hi,

 

You may need to access the source BlockTableRecord.DrawOrderTableId and propagate the order obtained from GetFullDrawOrder to the destination BlockTableRecord. Check a related sample code here http://through-the-interface.typepad.com/through_the_interface/2007/03/manipulating_th.html

 

Hope this help.

 

Augusto Goncalves

Autodesk Developer Network

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 3 of 3
nijhuis
in reply to: augusto.goncalves

Thanks augusto,

 

I found that link too and

after some puzzling that did the job!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost