Copying PaperSpace from Existing Layouts in C3D

Copying PaperSpace from Existing Layouts in C3D

artillis_prado
Enthusiast Enthusiast
388 Views
2 Replies
Message 1 of 3

Copying PaperSpace from Existing Layouts in C3D

artillis_prado
Enthusiast
Enthusiast
 

Hello, community!

 

I am currently studying and developing a C# code for manipulating layouts in AutoCAD. My objective is to copy the PaperSpace from an existing layout to a new layout.

 

 

 

List<BlockTableRecord> paperSpaces = new() { paperSpace };

 

 

 

I encountered an issue where I need to handle the entities correctly. Could someone provide guidance on how to convert or manipulate these entities so that I can successfully copy the PaperSpace to a new layout? Any help or examples would be greatly appreciated!

0 Likes
Accepted solutions (2)
389 Views
2 Replies
Replies (2)
Message 2 of 3

ActivistInvestor
Mentor
Mentor
Accepted solution

Is that all of the code you have? If so, and you're just starting out with the AutoCAD API, please make that clear.

 

To copy objects from one layout to another layout you have to use the Database's DeepCloneObjects() method, passing it an ObjectIdCollection containing the ObjectIds of all of the objects in the source layout that are to be copied, along with the ObjectId of the destination layout's BlockTableRecord.

0 Likes
Message 3 of 3

norman.yuan
Mentor
Mentor
Accepted solution
Not sure what exactly you want to do, and what exactly is the issue you encountered (it always is much better to describe your question in more details if you really expect someone could help without playing guessing game).

If you just want to create a new layout from an existing one, it might be as simple as calling LayoutManager.CopyLayout() method. Once the new layout is created after the call, you can make changes to it if needed.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes