Sheet Size...?

Valued Contributor
Valued Contributor

 

Dear All,

I am trying to change the sheet size from A2 to A0 or vice-versa. But it is not getting changed.Sheet size is changing but borders not getting update, this means i have to change the background sheet to A0 or A2. But i am not able to code it or i am not able to active the backgroud sheet thru coding.

Anybode has any idea? I am trying following  but nothing is working

ObjDft = ObjApp.Documents.Open(DFT_File)

        ObjDft = ObjApp.ActiveDocument

        ObjApp.DisplayAlerts = False

        ObjDft.Activate()

 

        'objSheet = ObjDft.ActiveSheet

        objSheet = ObjDft.Sheets.Item(1)

        '------ Trial --------------------------------------

objSheet.SheetSetup.SheetSizeOption = SolidEdgeDraft.PaperSizeConstants.igIsoA0Wide

             '-------------------------------------------------

OR

objSheet.BackgroundVisible = True

objSheet.Background.SheetSetup.SheetSizeOption=SolidEdgeDraft.PaperSizeConstants.igIsoA0Wide

 

Posted by: Prasad Pawar
Post date: 6/1/2008 9:17:03 PM

5 REPLIES

RE: Sheet Size...?

Valued Contributor
Valued Contributor

 

Prasad,  try this:

 lv_sheet = draftDoc.Sections.WorkingSection.Sheets.Item(1);

 lv_sheet.Activate();

 lv_sheet.SheetSetup.SheetSizeOption = PaperSizeConstants.igIsoA2TalligIsoA0Wide;

 

hth,

Sibi

 

Posted by: Seb Sosna
Post date: 6/6/2008 11:05:28 PM

RE: Sheet Size...?

Valued Contributor
Valued Contributor

 

You need to set the background of your sheet

workingsheet.Background = backgroundsheet

where backgroundsheet is a reference to the actual background sheet.

 

I would create a function/sub to copy all of the background sheet setup e.g. DefaultDrawingViewScaleOption, PaperUnits, SheetSizeOption,etc to your working sheet. Sorry but I can't post my code to do this.

 

hth,

James

 

Posted by: James Singleton
Post date: 6/12/2008 7:54:25 AM

RE: Sheet Size...?

Valued Contributor
Valued Contributor

 

'Dear Prasad i have written this code in VB.NET just try it works fine, if not then send reply me i will try to give a live code

Public objSheets As SolidEdgeDraft.Sheets

Public objSheet As SolidEdgeDraft.Sheet

Public backSheet As SolidEdgeDraft.Sheet

For Each objSheet In objSheets

cmbbgSheet.Items.Add(objSheet.Name) 'Add to combo box

Next

'on event of cmbSheets_SelectedIndexChanged write following code

For Each objSheet In objSheets

If (cmbSheets.Text = objSheet.Name) Then

backSheet = objSheet.Background

End If

Next

'CmdSetBgSheet_Click on write following code

For Each backSheet In objSheets

If (cmbbgSheet.Text = backSheet.Name) Then

objSheet.Background = backSheet

backSheetstr = backSheet.Name

objSheet.SheetSetup.SheetHeight = backSheet.SheetSetup.SheetHeight

objSheet.SheetSetup.SheetWidth = backSheet.SheetSetup.SheetWidth

objDraft.Save()

Exit For

End If

Next

 

 

Posted by: Sandeep Shewale
Post date: 6/12/2008 10:51:45 PM

RE: Sheet Size...?

Valued Contributor
Valued Contributor

 

'Dear Prasad i have written this code in VB.NET just try it works fine, if not then send reply me i will try to give a live code

Public objSheets As SolidEdgeDraft.Sheets

Public objSheet As SolidEdgeDraft.Sheet

Public backSheet As SolidEdgeDraft.Sheet

For Each objSheet In objSheets

cmbbgSheet.Items.Add(objSheet.Name) 'Add to combo box

Next

'on event of cmbSheets_SelectedIndexChanged write following code

For Each objSheet In objSheets

If (cmbSheets.Text = objSheet.Name) Then

backSheet = objSheet.Background

End If

Next

'CmdSetBgSheet_Click on write following code

For Each backSheet In objSheets

If (cmbbgSheet.Text = backSheet.Name) Then

objSheet.Background = backSheet

backSheetstr = backSheet.Name

objSheet.SheetSetup.SheetHeight = backSheet.SheetSetup.SheetHeight

objSheet.SheetSetup.SheetWidth = backSheet.SheetSetup.SheetWidth

objDraft.Save()

Exit For

End If

Next

 

 

Posted by: Sandeep Shewale
Post date: 6/12/2008 10:53:04 PM

RE: Sheet Size...?

Valued Contributor
Valued Contributor

Dear all,

i tried this code but don't run.

Have you a solution ?

 

Posted by: Filippo Colonna
Post date: 5/1/2011 9:26:35 PM