Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Zoom all in Drawing file

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
eladm
420 Views, 6 Replies

Zoom all in Drawing file

Hi

 

If in a drawing file(IDW)

I have Views that out of the border , the command Zoom All is only for views inside the border , Can I do a zoom to all my views in the sheet (some of them is outside of the border ?

eladm_0-1708853713627.png

 

regards

Tags (1)
Labels (1)
6 REPLIES 6
Message 2 of 7
Alexander_Chernikov
in reply to: eladm

Hi,

by default there is no such command, but you can create iLogic rule for this,

for example:

 

Sub Main () ' Camera.FitAll()
    Dim oSheet As Sheet
    Dim cam As Camera
    Dim xmin, ymin, xmax, ymax, xmini, ymini, xmaxi, ymaxi As Double
    Dim i As Integer
    Dim tg As TransientGeometry
    tg = ThisApplication.TransientGeometry
    oSheet = ThisApplication.ActiveDocument.ActiveSheet
    xmin = oSheet.DrawingViews(1).Left
    xmax = xmin + oSheet.DrawingViews(1).Width
    ymax = oSheet.DrawingViews(1).Top
    ymin = ymax - oSheet.DrawingViews(1).Height
    For i = 2 To oSheet.DrawingViews.Count
      xmini = oSheet.DrawingViews(i).Left
      xmaxi = xmini + oSheet.DrawingViews(i).Width
      ymaxi = oSheet.DrawingViews(i).Top
      ymini = ymaxi - oSheet.DrawingViews(i).Height
      If xmini < xmin Then xmin = xmini
      If ymini < ymin Then ymin = ymini
      If xmaxi > xmax Then xmax = xmaxi
      If ymaxi > ymax Then ymax = ymaxi
    Next
    xmini = xmin + (xmax - xmin) / 2
    ymini = ymin + (ymax - ymin) / 2
    cam = ThisApplication.ActiveView.Camera
    cam.Target = tg.CreatePoint(xmini, ymini, 0)
    cam.Eye = tg.CreatePoint(xmini, ymini, 20)
    Call cam.SetExtents(xmax - xmin, ymax - ymin)
    Call cam.ApplyWithoutTransition
End Sub

 

You can add it to global rules or template or to the ribbon.

Do you find the posts helpful? "LIKE" these posts! | Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням!
Have your question been answered successfully? Click "ACCEPT SOLUTION" button. | На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ"

Олександр Черніков / Alexander Chernikov

EESignature

Facebook | LinkedIn

.


Message 3 of 7
eladm
in reply to: Alexander_Chernikov

Hi

 

The code didn't do any change

 

Message 4 of 7
Alexander_Chernikov
in reply to: eladm

Can you add any your drawing file with multiview sheet?

Do you find the posts helpful? "LIKE" these posts! | Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням!
Have your question been answered successfully? Click "ACCEPT SOLUTION" button. | На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ"

Олександр Черніков / Alexander Chernikov

EESignature

Facebook | LinkedIn

.


Message 5 of 7
eladm
in reply to: Alexander_Chernikov

H

Sorry , it's works

Thx

Message 6 of 7
eladm
in reply to: Alexander_Chernikov

Hello

 

the rule don't work if the object is a text , it work fines with view.

can you change that the zoom include all kind of objects ?

eladm_0-1710074091791.png

 

regards

Message 7 of 7
Alexander_Chernikov
in reply to: eladm

Hello,

the new variant in attached file:

Do you find the posts helpful? "LIKE" these posts! | Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням!
Have your question been answered successfully? Click "ACCEPT SOLUTION" button. | На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ"

Олександр Черніков / Alexander Chernikov

EESignature

Facebook | LinkedIn

.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report