.NET
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Zoom Extents on new Database
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
934 Views, 13 Replies
09-17-2007 06:23 PM
I have created a new database:
Database newDb = new Database(true, true)
Inserted a block into modelspace
and now I want to zoom extent before saving.
Can this be done working on a new database in memory?
all the examples I have seen on this board use Interop on a open document.
Does anyone have a point in the right direction
Database newDb = new Database(true, true)
Inserted a block into modelspace
and now I want to zoom extent before saving.
Can this be done working on a new database in memory?
all the examples I have seen on this board use Interop on a open document.
Does anyone have a point in the right direction
Re: Zoom Extents on new Database
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-18-2007 09:49 AM in reply to:
Techno Destructo
Others have posted lots of good working methodologies ... search on zoomextents
Maybe these lines will give you a start ....
AcadApplication app = (AcadApplication)Autodesk.AutoCAD.ApplicationServi ces.Application.AcadApplication;
db.TileMode = false;//*PAPER_SPACE
db.TileMode = true;//*MODEL_SPACE
app.ZoomExtents();
------------------
LayoutManager layoutMgr = LayoutManager.Current;
layoutMgr.CurrentLayout = "Model";
AcadApplication pApp = (Autodesk.AutoCAD.Interop.AcadApplication)Autodesk .AutoCAD.ApplicationServices.Application.AcadAppli cation;
pApp.ZoomExtents();
db.UpdateExt(true);
Maybe these lines will give you a start ....
AcadApplication app = (AcadApplication)Autodesk.AutoCAD.ApplicationServi
db.TileMode = false;//*PAPER_SPACE
db.TileMode = true;//*MODEL_SPACE
app.ZoomExtents();
------------------
LayoutManager layoutMgr = LayoutManager.Current;
layoutMgr.CurrentLayout = "Model";
AcadApplication pApp = (Autodesk.AutoCAD.Interop.AcadApplication)Autodesk
pApp.ZoomExtents();
db.UpdateExt(true);
Re: Zoom Extents on new Database
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-19-2007 02:21 AM in reply to:
Techno Destructo
Thanks for the reply
It seems Autodesk.AutoCAD.ApplicationServices.Application.A cadApplication
ONLY apply to the document currently displayed in autocad.
Maybe I am missing a step but let me try to explain the problem again.
I have a drawing (drawing1) open.
I run my command that creates a NEW database in memory.
I insert a block in the NEW database (in memory) and I want to
Zoom extents and then save the database (drawing2).
When I use the examples in this forum including yours it zoom extents alright but in drawing1, not the new database.
I am still learning so I could be overlooking something
Any help is appreciated.
It seems Autodesk.AutoCAD.ApplicationServices.Application.A
ONLY apply to the document currently displayed in autocad.
Maybe I am missing a step but let me try to explain the problem again.
I have a drawing (drawing1) open.
I run my command that creates a NEW database in memory.
I insert a block in the NEW database (in memory) and I want to
Zoom extents and then save the database (drawing2).
When I use the examples in this forum including yours it zoom extents alright but in drawing1, not the new database.
I am still learning so I could be overlooking something
Any help is appreciated.
Re: Zoom Extents on new Database
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-19-2007 04:48 AM in reply to:
Techno Destructo
I'm not sure, but I don't think that ActiveX commands can be applied to the in-memory drawing.
Again, I might be mistaken.
Again, I might be mistaken.
Re: Zoom Extents on new Database
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-19-2007 01:28 PM in reply to:
Techno Destructo
I don't think you can zoom a *database*.
A *document* is required.
A *document* is required.
CAD Programming Solutions
Re: Zoom Extents on new Database
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-19-2007 03:13 PM in reply to:
Techno Destructo
Correct, it has to be the current dwg in the editor to do display changes.
*Tony Tanzillo
Re: Zoom Extents on new Database
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-19-2007 03:54 PM in reply to:
Techno Destructo
Who told you that?
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
wrote in message news:5726557@discussion.autodesk.com...
Correct, it has to be the current dwg in the editor to do display changes.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Correct, it has to be the current dwg in the editor to do display changes.
Re: Zoom Extents on new Database
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-20-2007 12:56 AM in reply to:
Techno Destructo
Thanks everyone
Maybe I can come at it from a different angle then.
When I complete the operations to the database save it and then open it as a drawing in AutoCAD, the view has been set for me, not where I would like (the extents of the block inserted)
How does one control where the initial view is located when creating a database?
Or is that view default and the need to specify has been overlooked?
Maybe I can come at it from a different angle then.
When I complete the operations to the database save it and then open it as a drawing in AutoCAD, the view has been set for me, not where I would like (the extents of the block inserted)
How does one control where the initial view is located when creating a database?
Or is that view default and the need to specify has been overlooked?
Re: Zoom Extents on new Database
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-20-2007 11:43 AM in reply to:
Techno Destructo
Tony,
Is there a way to "zoom" a database?
I made my comment based on my attempts at doing just that. I browsed the object model but saw no zoom functionality associated with the databaseservices. I only found zoom used with the application object and that only effected the active document.
Am I missing something? I know that there are plenty of undocumented or otherwise hidden pieces to the programming puzzle.
By the way, your CommandLine.cs worked fine for zooming but again that would only work on the currently active drawing.
Is there a way to "zoom" a database?
I made my comment based on my attempts at doing just that. I browsed the object model but saw no zoom functionality associated with the databaseservices. I only found zoom used with the application object and that only effected the active document.
Am I missing something? I know that there are plenty of undocumented or otherwise hidden pieces to the programming puzzle.
By the way, your CommandLine.cs worked fine for zooming but again that would only work on the currently active drawing.
CAD Programming Solutions
Re: Zoom Extents on new Database
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-20-2007 01:10 PM in reply to:
Techno Destructo
SO maybe zoom extents is not what I want.
Is there a way to specify the initial view on a new database.
The view is set by autocad when you create a new db can we change that default view I guess is the question?
Anyone know how?
Is it possible
Is there a way to specify the initial view on a new database.
The view is set by autocad when you create a new db can we change that default view I guess is the question?
Anyone know how?
Is it possible



