Zoom all in Drawing file

eladm
Collaborator
Collaborator

Zoom all in Drawing file

eladm
Collaborator
Collaborator

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

0 Likes
Reply
Accepted solutions (2)
481 Views
6 Replies
Replies (6)

Alexander_Chernikov
Mentor
Mentor
Accepted solution

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

.


eladm
Collaborator
Collaborator

Hi

 

The code didn't do any change

 

0 Likes

Alexander_Chernikov
Mentor
Mentor

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

.


0 Likes

eladm
Collaborator
Collaborator

H

Sorry , it's works

Thx

0 Likes

eladm
Collaborator
Collaborator

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

0 Likes

Alexander_Chernikov
Mentor
Mentor
Accepted solution

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

.