ObjectARX

Reply
Active Member
podoboq
Posts: 8
Registered: ‎11-30-2011
Message 1 of 4 (342 Views)
Accepted Solution

ZOOM ALL using code

342 Views, 3 Replies
10-29-2012 07:15 PM

There has a dwg file. After opening it, its extent don't show in the center of the screen.  I know "Zoom all" works, but how to do it using code without opening the dwg in Autocad? 

 

Thanks in advance.

Hi,

 

You can refer to the Developer's guide (arxdev.chm) from the ObjectARX folder about viewports.

Here is the explanation provided there :

 

<<<<

A viewport is a particular view of the drawing file, either in model space (TILEMODE=1) or paper space (TILEMODE=0). In model and paper space, viewports have different properties and are represented by objects of different types.

The current model space viewport configuration is contained in the AcDbViewportTable symbol table. The viewports in this configuration are represented by AcDbViewportTableRecord objects. Saved viewport configurations are contained in the AcDbViewTable symbol table and their views are represented by AcDbViewTableRecord objects. The model space viewports are always rectangular.

In a paper space layout, viewports are represented by AcDbViewport objects. These viewports can be complex clipped, that is they can be set to any arbitrary shape. In paper space, unlike model space, viewports do not need to be tiled. AcDbLayout objects, accessed from the ACAD_LAYOUT named object dictionary, describe the viewport configuration for that layout.

>>>>

 

By setting the viewport parameters, you ensure that the viewport displays the view that you are interested in.

 

You have mentioned that you have already found a sample code, but anyway here is one from the Devblog :

http://adndevblog.typepad.com/autocad/2012/10/zooming-to-drawing-extents-for-a-viewport-without-sending-commands.html

 

Hope this helps

Active Member
podoboq
Posts: 8
Registered: ‎11-30-2011
Message 2 of 4 (312 Views)

Re: ZOOM ALL using code

11-01-2012 07:53 PM in reply to: podoboq

I've find some help. Maybe it relates to manipulate AcdbView or AcdbViewport. 
What's the differenc between view and viewport?  To implement "Zoom All", whick one should be choosed?

 

Thanks a lot.

ADN Support Specialist
Balaji_Ram
Posts: 749
Registered: ‎03-21-2011
Message 3 of 4 (291 Views)

Re: ZOOM ALL using code

11-05-2012 04:07 AM in reply to: podoboq

Hi,

 

You can refer to the Developer's guide (arxdev.chm) from the ObjectARX folder about viewports.

Here is the explanation provided there :

 

<<<<

A viewport is a particular view of the drawing file, either in model space (TILEMODE=1) or paper space (TILEMODE=0). In model and paper space, viewports have different properties and are represented by objects of different types.

The current model space viewport configuration is contained in the AcDbViewportTable symbol table. The viewports in this configuration are represented by AcDbViewportTableRecord objects. Saved viewport configurations are contained in the AcDbViewTable symbol table and their views are represented by AcDbViewTableRecord objects. The model space viewports are always rectangular.

In a paper space layout, viewports are represented by AcDbViewport objects. These viewports can be complex clipped, that is they can be set to any arbitrary shape. In paper space, unlike model space, viewports do not need to be tiled. AcDbLayout objects, accessed from the ACAD_LAYOUT named object dictionary, describe the viewport configuration for that layout.

>>>>

 

By setting the viewport parameters, you ensure that the viewport displays the view that you are interested in.

 

You have mentioned that you have already found a sample code, but anyway here is one from the Devblog :

http://adndevblog.typepad.com/autocad/2012/10/zooming-to-drawing-extents-for-a-viewport-without-send...

 

Hope this helps



Balaji
Developer Technical Services
Autodesk Developer Network

Active Member
podoboq
Posts: 8
Registered: ‎11-30-2011
Message 4 of 4 (271 Views)

Re: ZOOM ALL using code

11-06-2012 05:20 PM in reply to: Balaji_Ram

Thanks. Balaji.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.