Community
Need to get inside the viewport in paperspace and run the command CHSPACE to bring some layers to the modelspace viewport. How to do this programmatically?
The principle is as follows:
[CommandMethod("ChangeViewports")] public static void ChangeViewports() { Document document = Application.DocumentManager.MdiActiveDocument; Database database = document.Database; Editor editor = document.Editor; using (Transaction transaction = database.TransactionManager.StartTransaction()) { ObjectIdCollection objectIdCollection = database.GetViewports(false); foreach (ObjectId id in objectIdCollection) { Viewport viewport = transaction.GetObject(id, OpenMode.ForWrite) as Viewport; if (viewport.StandardScale == StandardScaleType.Scale1To1) viewport.Erase(); else { //Run this command CHSPACE viewport } } transaction.Commit(); } }
Thank you!
Hi
You can run a command using Document.SendStringToExecute. However I don't really understand the point of your question as same layers exist in both model and paper spaces, I don't see how you're going to use CHSPACE to import a layer from model to paper, this command only applies to entities...
Regards,
Philippe.
Is this what you are after?
Selecting Model Space entities from Paper Space
Can't find what you're looking for? Ask the community or share your knowledge.