Change the Width and Height of a Sheet by Inventor API

By Barbara Han

To set a sheet to a specific width and height, directly writing the width and height property of the sheet will not work if you don’t specify the size property kCustomDrawingSheetSize from DrawingSheetSizeEnum in advance.

Here is a VB.NET sample code demonstrating how to do that:

Sub setSheetSize()
        Dim st As Sheet
        Dim dw As DrawingDocument
        dw = Thisapplication.ActiveDocument

        st = dw.ActiveSheet
        Dim w As Double
        w = st.Width / 2

        Dim h As Double
        h = st.Height / 2

        st.Size = DrawingSheetSizeEnum.kCustomDrawingSheetSize

        st.Height = h
        st.Width = w
    End Sub


Comments

4 responses to “Change the Width and Height of a Sheet by Inventor API”

  1. How do I set whether the Custom Size is in inches or mm? When I set the custom sheet size my title block always says “Custom Size (mm)”

  2. Inventor always requires metric units internally.

  3. vilas jadhav Avatar
    vilas jadhav

    dear sir ,
    i am working for inventor customization,
    i have used following code to generate view .
    but sometime the parts views is bigger than sheet , how to set the fit the view of particular height and width . please help me for this.
    oFrontView = oSheet.DrawingViews.AddBaseView(oSheetMetalDoc, oTG.CreatePoint2d(12.066, 9.466), 1.0#, ViewOrientationTypeEnum.kCurrentViewOrientation,
    DrawingViewStyleEnum.kHiddenLineDrawingViewStyle, “FlatPattern”, , oBaseViewOptions)

  4. Steeloncall Avatar
    Steeloncall

    Using of the steel materials for construction process is required to make the development strong. And these steel materials can get from steeloncall.com.
    https://steeloncall.com/brands/tata-tiscon
    https://steeloncall.com/brands/simhadri-tmt
    https://steeloncall.com/brands/jindal

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading