Cmb Posted November 30, 2023 Share Posted November 30, 2023 (edited) Hi dear community, I'm trying to iterate over viewports in a sheet layer and want to skip sections viwports. I tried many ways, but none gives results. VWViewportObj vp_obj(h); auto type = vp_obj.GetType(); auto is_section = vp_obj.IsHorizontalSection(); bool is_section2; vp_obj.GetIsDesignLayerSectionViewport(is_section2); returned type is always viewport (const short kViewportNode = 122;) (which is expected), but is_section and is_section2 always return false for my cases (a mix of standard viewports and section viewports); I found the enum values I need, but cannot find the function to call to get them. Thank you in advance for your help. Cmb Cmb Edited November 30, 2023 by Cmb Quote Link to comment
Stefan Bender Posted November 30, 2023 Share Posted November 30, 2023 Try reading object variable ovIsSectionViewport (use ISDK::GetObjectVariable()). There's a list of all available object variables in ObjectVariables.h. Quote Link to comment
Cmb Posted December 1, 2023 Author Share Posted December 1, 2023 Thank you for your answer Stefan. We are still on the VS2020 version, and we don't have the header ObjectsVariables.h, but MiniCadCallbacks.h. We found the value 1054 by inspecting VW2023 SDK. TVariableBlock var; gSDK->GetObjectVariable(vp_obj, 1054, var); //ovIsSectionViewport only in 2023 bool is_section_viewport; var.GetBoolean(is_section_viewport); I tried reading tha value for viewports, but the behaviour is not what I expected. As soon as one viewport in my sheet layer is a section viewport, all viewports (standard viewports and section viewports) will return true. Is this the expected behaviour ? Thanks again for your help, Olivier Quote Link to comment
Stefan Bender Posted December 1, 2023 Share Posted December 1, 2023 I don't think this is expected behavior. You might wish to submit a bug. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.