Create draft view with Best Fit Scale

Valued Contributor
Valued Contributor

Hi, I'm using the create drawings views to create a draft view of a given .psm. But the problem is that I want the view to fit the sheet, and it doesnt seem to be possible using the igPrincipleView arguments scale , x , y. You can only type in a number.

Has any body tried this

Thanks.

 

 oDocD = oDocs.Add("SolidEdge.DraftDocument", TemplateDoc:="I:\SOLIDEDGE\template\Quicksheet\GABARIT.dft")
        oSheet = oDocD.ActiveSheet
        oMlink = oDocD.ModelLinks.Add(sParFile)
        oView = oSheet.DrawingViews.AddSheetMetalView(oMlink, SolidEdgeDraft.DrawingViewTypeConstants.igPrincipleView, 1, 0, 0, SolidEdgeDraft.SheetMetalDrawingViewTypeConstants.seSheetMetalFlatView)
ST9
Conveyor and industrial equipment designer.
Giving SE a chance.
2 REPLIES

Re: Create draft view with Best Fit Scale

Valued Contributor
Valued Contributor

I have a feeling I might have to use

DraftPrintScaleTooLargeActionConstants.igDraftPrintScaleToFit

Since I'm doing this to save it in .PDF. Having trouble making it work.

ST9
Conveyor and industrial equipment designer.
Giving SE a chance.
Highlighted

Re: Create draft view with Best Fit Scale

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

Hi,

 

you could try to change the size of the DraftView object to the available width and height of the sheet via API by your own.

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de