Disappearing hatch in custom entity only on Acad 2017

Disappearing hatch in custom entity only on Acad 2017

Anonymous
Not applicable
552 Views
2 Replies
Message 1 of 3

Disappearing hatch in custom entity only on Acad 2017

Anonymous
Not applicable

Hi, I have very strange problem. One of our testers showed it to me and then I tried to reproduce this on my machine. I failed. But then I deleted autocad tree from registry (current user) restoring its default settings and now this problem occurs.

 

So, we have entity which constist of 4 lines and solid green hatch. Kind of area.

When I draw first area, everything is fine. You can see it in attachement: evac1.png.

 

Now, I want to create another area but on the first one. And the result is that hatch disappears from the first entity. You can see it on evac2.png.

The strange thing is that this code works on every Autocad below 2017. And as I have said at the beginning, it has something to do with Autocad settings.

 

Hatch is being drawn in subWorldDraw everytime. So, maybe someone has seen something like that before? What's the problem here?

0 Likes
553 Views
2 Replies
Replies (2)
Message 2 of 3

Alexander.Rivilis
Mentor
Mentor

@Anonymous wrote:

 

...Hatch is being drawn in subWorldDraw everytime. So, maybe someone has seen something like that before? What's the problem here?


Without your subWorldDraw code? Hm... If you think that it is AutoCAD 2017 bug you have to create sample project which can be tested.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 3 of 3

Anonymous
Not applicable

I mean inside my subWorldDraw.

Unfortunately I am not able to create sample project, because this is part of bigger system. But this all works on other versions. And before settings reset it worked as well. This is part of my code from subWorldDraw.

 

My entity is some kind of super entity that can be anything. A line. Rectangle. Rabbit 🙂 So all its "subentities" are stored in a vector and are properly created while creating my entity. I hope that you understand, what I'm doing.

 

 

for(Entities::iterator it = m_pEntities->begin(); it != m_pEntities->end(); ++it)
{		 
	bool isSolidHatch = false; //added this just for test

	if(it->first->isA()->isDerivedFrom(AcDbHatch::desc()))
	{
		AcDbHatch * pHatch = (AcDbHatch *)it->first;
		if (pHatch->isSolidFill())
		{
//solid hatches must have special gs marker pWd->subEntityTraits().setSelectionMarker(FIRST_HATCH_GSMARKER * (index + 1)); isSolidHatch = true; } else pWd->subEntityTraits().setSelectionMarker(0); } else pWd->subEntityTraits().setSelectionMarker(FIRST_ENT_GSMARKER + index);
if(!isSolidHatch) //just for test, but doesn't work pWd->subEntityTraits().setFillType(kAcGiFillNever); //set the color if(it->first->color().colorMethod() == AcCmEntityColor::kByColor) { AcCmColor & cl = it->first->color(); AcCmEntityColor trueColor(cl.red(), cl.green(), cl.blue()); pWd->subEntityTraits().setTrueColor(trueColor); } else pWd->subEntityTraits().setColor(it->first->colorIndex()); //line properties pWd->subEntityTraits().setLineType(it->first->linetypeId()); pWd->subEntityTraits().setLineTypeScale(it->first->linetypeScale()); pWd->subEntityTraits().setLineWeight(it->first->lineWeight()); it->first->worldDraw(pWd); index++; } return true;

 

Maybe this is something with one system variable. Changing order in sortents table. Or intersecting bounding boxes.

 

0 Likes