Bug? Seting Sheet.Height value actually sets Sheet.Width

Bug? Seting Sheet.Height value actually sets Sheet.Width

Anonymous
Not applicable
401 Views
2 Replies
Message 1 of 3

Bug? Seting Sheet.Height value actually sets Sheet.Width

Anonymous
Not applicable

I'm running a VBA script that sets the sheet height and width according to the size of the view I'm placing which I'm exporting as a 1:1 scale DXF. I then center the drawing view to the center of the sheet.

 

What I've found through debugging and using a break point, is that when I run

 

oSheet.Height = docHeight

 

where docHeight is a double with a value, that oSheet.Width gets set with the value of docHeight. Then I run the next line

 

oSheet.Width = docWidth

 

where docWidth is a double with a different value, and this is set correctly.

 

Can any confirm this? I tried to simplify my script to show this behaviour but I couldn't replicate it. But when I run my script it is buggy.

 

Also, when I experience this, when I go into the "Edit Sheet" manually, and set the height to a number, hit OK, it sets the Width to the height number and puts the width to the Height value and vice versa.

 

Can someone confirm that if you set in a drawing the sheet size to custom (either mm or Inch, it's the same behaviour) and change the height to be larger than the width and then hit ok, that the width becomes the entered height, and that the height becomes the old width.

Inventor HW Switching.jpg

 

 

 

 

 

 

 

 

 

Is this expexted behaviour, and if so, do I just have to program around this with comparing height to width and Portrait vs. Landscape?

 

Running Inventor 2014, 64 Bit, Build 246, Releace 2014 SP2

 

Any help would be appreciated.

 

Thanks!

0 Likes
Accepted solutions (1)
402 Views
2 Replies
Replies (2)
Message 2 of 3

brendan.henderson
Advisor
Advisor

Just a guess but it appears to be tied to the orientation of the sheet, Landscape versus Portrait. Not a programmer, just observant of your great pictures.

Brendan Henderson
CAD Manager


New Blog | Old Blog | Google+ | Twitter


Inventor 2016 PDSU Build 236, Release 2016.2.2, Vault Professional 2016 Update 1, Win 7 64 bit


Please use "Accept as Solution" & give "Kudos" if this response helped you.

0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

Yes, I think so as well. I just came up with a little check below and then set accordingly. 

 

With oSheet
        If docHeight > docWidth Then
            .Orientation = kPortraitPageOrientation
            .Height = docHeight
            .Width = docWidth
            
        Else
            .Orientation = kLandscapePageOrientation
            .Width = docWidth
            .Height = docHeight
        End If
    End With

 

0 Likes