AcEdInputPointMonitor and Transient Graphics Layer

AcEdInputPointMonitor and Transient Graphics Layer

Kyudos
Advisor Advisor
1,358 Views
5 Replies
Message 1 of 6

AcEdInputPointMonitor and Transient Graphics Layer

Kyudos
Advisor
Advisor

In my ARX, one of my functions uses on input point monitor to draw some transient graphics like this:

 

AcEdInputPointMonitor::monitorInputPoint(const AcEdInputPoint& input, AcEdInputPointMonitorResult& output)
{
    ...
    Adesk::Boolean b = input.drawContext()->geometry().circle(pt1, pt2, pt3);
}

Now it seems that my circle is drawn on layer 0 - if layer 0 is off, no circle!

 

I could ensure that layer 0 is on - but surely the visibility of transient graphics shouldn't be layer dependent?

Can I work around this some other way? I suppose some users might have legitimate reasons for having layer 0 off.

0 Likes
Accepted solutions (2)
1,359 Views
5 Replies
Replies (5)
Message 2 of 6

Kyudos
Advisor
Advisor

Actually - this only applies to ACAD 2018. It doesn't seem to be working at all in ACAD 2017...

0 Likes
Message 3 of 6

Kyudos
Advisor
Advisor

OK...the problem in 2017 turned out to be related to hardware acceleration. If I turn off "High Quality Geometry" in the Graphics Performance settings my circle is back. However, its visibility is still controlled by layer 0.

 

Any ideas?

0 Likes
Message 4 of 6

moogalm
Autodesk Support
Autodesk Support
Accepted solution

If you are drawing a circular glyph on cursor point, I don't see why a Layer turning off has any affect, I have just tried, I don't see the behavior.

 

Attached a image for your reference, btw I have tested both

  1. turning  off Layer 0 and while it is being current layer
  2. turning off Layer 0 and while it is not being a current layer.

 

In both the case, I can't reproduce, can you offset the circular glyph from the input computed point.

 

output.setNewPoint(input.computedPoint() + AcGeVector3d(0.2,0.2,0.0));
        input.drawContext()->geometry().circle( output.newPoint(), 0.1, AcGeVector3d::kZAxis );

 

GylphOnCursor.JPG

 

 

0 Likes
Message 5 of 6

Kyudos
Advisor
Advisor

As per your code, I can draw an offset glyph, but it is still controlled by Layer 0.

 

Layer 0 OffLayer 0 Off       Layer Zero OnLayer Zero On

 

However, I'm not sure what output is in your code. My output is a AcEdInputPointMonitorResult, and doesn't have the same functions as yours?

0 Likes
Message 6 of 6

Kyudos
Advisor
Advisor
Accepted solution

I have found the culprit! Prior to my circle drawing I have this:

 

AcColorSettings acs;
if (acedGetCurrentColors(&acs))
{
    unsigned char a,r,g,b;
    DWORD dwIn = acs.dwModelCrossHairColor;

    a = (dwIn >> 24);
    r = (dwIn >> 16) & 255;
    g = (dwIn >> 8) & 255;
    b = (dwIn & 255);

    AcCmEntityColor cm(r, g, b);
    input.drawContext()->subEntityTraits().setTrueColor(cm);
}

I was attempting to use the crosshair colour as my graphics colour, thinking this would ensure visibility whatever the colour scheme. However, it seems like AutoCAD handles that automatically with some sort of XORing. Setting the colour seems to introduce the Layer 0 dependency, if I leave it out the graphics always show!

 

0 Likes