Jump to content
Developer Wiki and Function Reference Links ×

How to get Viewport subtype (section or not)?


Cmb

Recommended Posts

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.

 

image.thumb.png.7a34e27c09c1fdbd4bcc874783471e02.png

 

 

Thank you in advance for your help.

 

Cmb

 

 

Cmb

Edited by Cmb
Link to comment

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

 

image.png.ae4f87ab8d65d3a9b7365cae32a139ef.png

 

 

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...