Hi, I searched the samples in the arx sdk, and found little about operating multi viewports with arx.
you can see the picture below, I opened two dwgs in two windows, (I can't open two different dwgs in two viewports?), I want to operate on one dwg, and the second can reflect the change by code.
Solved! Go to Solution.
Solved by Balaji_Ram. Go to Solution.
I think synchronizing two different drawings will be quite challenging. What exactly is your question about "multi viewport"? It should be obvious that you need a separate document for separate drawings.
sorry for delay, One of my project need to synchronize two different drawings, and I found little to help in sdk, so could provide some example?
I have two dwgs, I want to do like this: select one entity in the first dwg, and thround command or menu, the second dwg can zoom to some extend. the two dwgs contain some common infomation for synchronizing.
Sorry, I don't know of any samples specifically for synchronizing views. I have seen many posts about zooming to specific coordinates. I don't have any links handy, but I'm sure you can find such samples on your own. Once you have code for zooming to coordinates, you can create a command in the target document that does the zooming, then use e.g. AcApDocManager::sendStringToExecute() to start that command in the target document. It may be possible to perform the zooming without using a command, but I think using the command processor will be the simplest way.
There is no direct API to keep the model space viewports in sync. You will need to monitor the view changes and apply the view parameters to the other viewport. Also, it gets more challenging depending on the viewport size.
Here is a blog post that I created assuming you have only two model space viewports that are of equal width and vertical split. Hope this provides some ideas for your own implementation.
http://adndevblog.typepad.com/autocad/2014/07/synchronizing-model-space-viewports.html
Regards,
Balaji
Can't find what you're looking for? Ask the community or share your knowledge.