roseanna Posted March 3, 2011 Share Posted March 3, 2011 I have just started converting some VBA to .net. In my code I had put Application.AcadApplicaton.ZoomExtents and it was working. Yesterday I started adding new code and discovered that the ZoomExtents was no longer working. VS2008 doesn't give an error but the routine is no longer doing it's job. Does anyone have any suggestions? Thanks Rose Anna Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted March 3, 2011 Share Posted March 3, 2011 Is it not in extents already? Quote Link to comment Share on other sites More sharing options...
roseanna Posted March 3, 2011 Author Share Posted March 3, 2011 I don't really understand. I am running a .net program in debug mode. The de****** automatically opens a drawing, then I do netload and load the .dll, then I run a command that creates objects and adds to the document/transaction. After the command has run, I need to run zoom extents to get a full view of the drawing. The command can create the same drawing but different sizes for the objects. I did try to change the template I used to include ANSI standards and changing dimensions attribute but that shouldn't have anything to do with the zoomextents command ???? Dim acDoc As Document acDoc = Application.DocumentManager.MdiActiveDocument Dim acCurDb As Database acCurDb = acDoc.Database Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction() Dim acBlkTbl As BlockTable acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) Dim acModelSpace As BlockTableRecord acModelSpace = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite) dim radCir = inputA Dim acCirc1 As Circle = New Circle() acCirc1 .SetDatabaseDefaults() acModelSpace.AppendEntity(acCirc1 ) acTrans.AddNewlyCreatedDBObject(acCirc1 , True) acCirc1 .Center = New Point3d(0, 0, 0) acCirc1 .Radius = radCir acTrans.Commit() Application.AcadApplication.ZoomExtents() ''' This is the command that no longer works ???? End Using Thanks Quote Link to comment Share on other sites More sharing options...
roseanna Posted March 3, 2011 Author Share Posted March 3, 2011 How very interesting. My code is now working. I reset my autocad system to not use ANSI standards. Any insights?? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.