Hi, I have read all posts but didn't find anything about my problem.
My code works on ADS, but I want to migrate it to ObjectARX.
I have an entity - rectangular polyline (square ;)) with diagonal and hatching. Hatching is solid it makes some kind of background. But when I rewrote this to ObjectARX hatching covers my entity. I can only see hatched square. Original entity has also Wipeout object. But after added AcDbWipeout nothing changes. My question is - how can I "send hatching to back" so it would be a real background insetad of a cover.
Look up AcDbSortentsTable in the ObjectARX reference to see if that helps.
Unfortunately, my AcDbHatch object is NOT in database. So I'm getting errors while trying to move it to bottom using sortents table. Maybe there is some other way? In ads this was achieved somehow by Wipeout. Wipeout was drawn on the whole entity. But in ObjectARX AcDbWipeout (drawn as last subentity) does nothing.
From your followup it sounds like you're describing a complex custom entity class that uses non-DBR entity objects for drawing. What exactly did you mean by "My code works on ADS"? You haven't posted any code, so it's unlikely that anyone will be able to help without a lot of guesswork.
Hey, sorry for not answering for a while, but I had to focus on different problem.
So, let's go back to this.
I have my custom entity. It consists of polyline, line and hatch. It looks like rectangle(polyline) with diagonal(line) and background(solid hatch). But my hatch covers this diagonal line.
For now I can give you some feel about how my code looks like, because it's too big. So it's something like:
1. Create AcDbPolyline. I don't add it to database. I use it to draw my entity and so on.
2. Create AcDbLine - don't add to db.
3. Create AcDbHatch - don't add to db.
Now in subWorldDraw I have something like:
m_pHatch->worldDraw(pwd);
m_pPoly->worldDraw(pwd);
m_pLine->worldDraw(pwd);
So I draw hatch as first entity, but still it covers my diagonal line.
looks like something wrong with your hatch creation
1. hatch have to be created with a help of points and bulges
m_hatch->appendLoop(AcDbHatch::kDefault,AcGePoint2dArray,AcGeDoubleArray);
your AcGePoint2dArray will contain pt1,pt2,pt3,pt4,pt1
your AcGeDoubleArray - 0.0, 0.0, 0.0, 0.0, 0.0
2. i use mode->geometry().draw(...);
Documentation says there is no difference, but, who knows )))
PS: my hatch creation for example
AcDbHatch * m_hatch = new AcDbHatch(); es = m_hatch->setPattern(AcDbHatch::kPreDefined, _T("SOLID")); es = m_hatch->setPatternScale(1.0); es = m_hatch->setAssociative(false); es = m_hatch->appendLoop(AcDbHatch::kDefault,vertices,bulges); es = m_hatch->setHatchStyle(AcDbHatch::kNormal); es = m_hatch->setColorIndex(colorIndex()); es = m_hatch->setLayer(layer()); es = m_hatch->setLinetype(_T("Continuous")); if((es = m_hatch->evaluateHatch()) == Acad::eOk) { mode->geometry().draw(m_hatch); //... } else delete m_hatch;
I have the same problem. It seems to appear only with AutoCAD 2015.
If I draw a text or polyline in front of a hatch, the last drawn hatch (if more than one) always covers the text or polyline underneath.
I tried the same code with other AutoCAD Versions 2014, 2016.
In this case the text or polyline is above the hatch, as it should be.
What can I do?