Jump to content

Recommended Posts

Posted

Does anyone know how to do this?

following is my code, when I define cadDoc as AcadDocument,

it works fine. Once I changed it to AxDbDocument

it gave me errors.

 

cadDoc.MSpace = True   '<---- get error
cadDoc.Application.ZoomExtents  '<---- get error
cadDoc.MSpace = False   '<---- get error
vp2.DisplayLocked = True

Posted
Does anyone know how to do this?

following is my code, when I define cadDoc as AcadDocument,

it works fine. Once I changed it to AxDbDocument

it gave me errors.

 

cadDoc.MSpace = True   '<---- get error
cadDoc.Application.ZoomExtents  '<---- get error
cadDoc.MSpace = False   '<---- get error
vp2.DisplayLocked = True

 

I'm not a VBA'er but it looks like DBX docs don't support the zoom methods:

 

; IAxDbDocument: IAxDbDocument Interface

; Property values:

; Application (RO) = Exception occurred

; Blocks (RO) = #

; Database (RO) = #

; Dictionaries (RO) = #

; DimStyles (RO) = #

; ElevationModelSpace = 0.0

; ElevationPaperSpace = 0.0

; FileDependencies (RO) = #

; Groups (RO) = #

; Layers (RO) = #

; Layouts (RO) = #

; Limits = (0.0 0.0 12.0 9.0)

; Linetypes (RO) = #

; Materials (RO) = #

; ModelSpace (RO) = #

; Name = ""

; PaperSpace (RO) = #

; PlotConfigurations (RO) = #

; Preferences (RO) = #

; RegisteredApplications (RO) = #

; SectionManager (RO) = Exception occurred

; SummaryInfo (RO) = #

; TextStyles (RO) = #

; UserCoordinateSystems (RO) = #

; Viewports (RO) = #

; Views (RO) = #

; Methods supported:

; CopyObjects (3)

; DxfIn (2)

; DxfOut (3)

; HandleToObject (1)

; ObjectIdToObject (1)

; Open (2)

; Save ()

; SaveAs (2)

Posted

thanks...

Is there any other way to work around it? like change the viewport scale, stuff like that?

The autoCAD marco is just too slow. we have 3000 drawings. so could take many days...

  • 2 weeks later...
Posted

Spent the last hour or so looking through the object model for this without any luck, however, this information has to be stored in the document somewhere

 

If we can find where this is stored and it isn't read only we can then scope each entity for the x and y extents of the document and use these to define the zoom factor

 

I intend to do a bit more scouting when I get back home. Until then hopefully this will give some indication as to how this could be resolved.

 

Good luck

Ollie

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...