Change Drawing Sheet format Using VB.NET (Sheet Setup)
- January 31, 2017
- 1 reply
- 2062 views
Hi Guys,
I need to change Drawing Sheet format Using VB.NET, I tried with below coding and I am getting error while "fdescr = (New CCpfcModelDescriptor)."
Please help to solve.
Coding:
If Not lmoddoc Is Nothing Then
Dim x As Integer
Dim sheets As Integer
Dim sheetdata As IpfcSheetData
Dim sheetformat As IpfcDrawingFormat
Dim drwonr As IpfcSheetOwner
Dim fdescr As IpfcModelDescriptor
Dim drw As pfcls.IpfcDrawing
Dim drwl As IpfcLayout
Dim bsession As IpfcBaseSession
Dim drawing As IpfcDrawing
lmoddoc.Display()
session.CurrentWindow.Activate()
model = session.CurrentModel
drawing = CType(model, IpfcDrawing)
fdescr = (New CCpfcModelDescriptor).CreateFromFileName("C:\Program Files\PTC\Creo 2.0\Common Files\F000\creo_standards\formats\a4_format.frm")
Dim fmt As IpfcDrawingFormat
fmt = session.RetrieveModel(fdescr)
drwonr = CType(drawing, IpfcSheetOwner)
drwonr.SetSheetFormat(1, fmt, 1, Nothing)
End If
Error:
Please find attached file for error report
Could you Please confirm whether my code is correct or wrong when i try to retrievemodel
if it is possible to update current drawing sheet width and height, its very useful.

