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.
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!
Solved! Go to Solution.
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.
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