Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7748605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:49:40+00:00 2026-06-01T10:49:40+00:00

I have a VBA script that imports a layout into an exsting drawing, its

  • 0

I have a VBA script that imports a layout into an exsting drawing, its a paperspace layout and contains one acadPViewport to view the model with.

I need to set a sensible default view, the easiest way to do this is to set the viewport to the extents of the model.

I can do this by calling:

VP.standardscale = acVPScaleToFit
'(optional, I've tried adding these to no effect)
VP.update
currentDocument.Regen

I’ve experimented and this code call. If I find the viewport in the immediate window, while not running any macros or routines, by referencing:

ThisDrawing.ActiveLayout.block(1).standardscale = acvpscaletofit

it has the desired effect of calling ZoomExtents within the pViewport (as far as I can tell it recenters and recalculates the extents, which is what I’m looking for).

When I run exactly the same code inside my main code it has no effect.

Any ideas appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:49:42+00:00Added an answer on June 1, 2026 at 10:49 am

    The answer, it turns out, is that many features of AutoCAD won’t work if the main application is off-screen, hidden, minimised or was at file load.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VBA script that inserts long strings into Excel cells. In some
I have a vba script which is supposed to copy data from one sheet
I have created a VBA script that detects a number and shows a colour
I would like to have a complex form that uses various VBA script files.
I have a large VBA script file that references the cells of an excel
I have an Excel VBA Script I've written with help, I am not a
I am trying to write a VBA script which imports all of the Excel
i need to write a vba script that will find a file. the file
I have some VBA code that opens a webpage, then calls a javascript function
I have a problem with my VBA script in Excel. What I do is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.