Viewport Specific geometry

Viewport Specific geometry

Anonymous
Not applicable
538 Views
1 Reply
Message 1 of 2

Viewport Specific geometry

Anonymous
Not applicable

Hi all,

 

I want to draw a viewport specific entity using AcGiViewportGeometry object. How could I display my custom entity only on the active viewport when I have more than one viewports in model space?       For example, I want to draw a polygon int the first viewport and  a circle in the second one.

 

Any help would be greatly appreciated

0 Likes
539 Views
1 Reply
Reply (1)
Message 2 of 2

tbrammer
Advisor
Advisor

If you have a custom entity, you can write your own virtual method:

 

 

 

void myEntity::subViewportDraw(AcGiViewportDraw* mode)
{
AcGiViewport &vp = mode->viewport(); Adesk::ULongPtr id = vp.viewportId();

AcGePoint2d lower_left, upper_right;
vp.getViewportDcCorners(lower_left, upper_right);
// Do your VP specific drawing depending on id or DC corners }

 

subViewportDraw() will only be called, if your  myEntity::subWorldDraw(AcGiWorldDraw* mode)  returns  Adesk::kFalse.

 

Cheers

--Thomas

 

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes