Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
c.silby
303 Views, 2 Replies

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

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!

2 REPLIES 2
Message 2 of 3
brendan.henderson
in reply to: c.silby

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.

Message 3 of 3
c.silby
in reply to: brendan.henderson

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

 

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

Post to forums  

Autodesk Design & Make Report