Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hello.
I would like to change the active sheet on a drawing using VBA-API, but I can't find any way to do it, I'm new to VBA-API. The best I cold manage was to use macro to change sheets, which worked, but did produce somr undesired effect.
The documentation states "You can regenerate a sheet only if it is displayed.", so it must be possible to change the displayed sheet.
My code so far
Public Sub change_sheet_parameter() Dim conn As IpfcAsyncConnection Dim cAC As CCpfcAsyncConnection Dim session As IpfcBaseSession Dim model1 As IpfcModel Dim sheetData As IpfcSheetData Dim sheetowner As IpfcSheetOwner Dim sheetInfo As IpfcSheetInfo Set cAC = New CCpfcAsyncConnection Set conn = cAC.Connect("", "", ".", 5) Set session = conn.session Dim oModelDescriptorCreate As New CCpfcModelDescriptor Dim oModelDescriptor As IpfcModelDescriptor name_w = "SHM-7457-004.drw" 'Name of the drawing Set oModelDescriptor = oModelDescriptorCreate.Create(EpfcMDL_DRAWING, name_w, Null) Set model1 = session.RetrieveModel(oModelDescriptor) Set sheetowner = model1 Dim oWindow As pfcls.IpfcWindow Set oWindow = session.OpenFile(oModelDescriptor) oWindow.Activate Set sheetInfo = sheetowner.GetSheetInfo(1) test_ = sheetInfo.Height MsgBox test_ 'The part where I would like to change the displayed sheet. sheetowner.RegenerateSheet (1) End Sub