.NET

Reply
Contributor
nijhuis
Posts: 16
Registered: ‎09-26-2010
Message 1 of 3 (183 Views)
Accepted Solution

How to retain draworder with copy-command

183 Views, 2 Replies
11-22-2011 02:47 AM

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,

 

 

 

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

ADN Support Specialist
augusto.goncalves
Posts: 358
Registered: ‎04-30-2009
Message 2 of 3 (157 Views)

Re: How to retain draworder with copy-command

11-24-2011 06:06 AM 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
Autodesk Developer Network
Contributor
nijhuis
Posts: 16
Registered: ‎09-26-2010
Message 3 of 3 (151 Views)

Re: How to retain draworder with copy-command

11-24-2011 06:58 AM in reply to: augusto.goncalves

Thanks augusto,

 

I found that link too and

after some puzzling that did the job!

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.