.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Troubles with EvaluateHatch()

5 REPLIES 5
Reply
Message 1 of 6
Matt S
940 Views, 5 Replies

Troubles with EvaluateHatch()

I have found that if I have a small area to hatch, and the hatch scale is set too high, calls to EvaluateHatch throw eAmbiguousOutput exceptions, or maybe they are eAmbiguousInput. I don't remember exactly, but in any case, the docs don't mention this kind of beharior.

My question is this. I need to call evaluatehatch so the hatch shows up on the screen after it's placed in the database. Is there another way to force a screen update. I ahve tried doing a regen using ads_regen(), but that didn't work. As a workaround, I have reduced my hatchscale by 30%, and this seems to work in all cases, but I would rather not have to do this. This is all for Acad2006 btw.

Any advice is appreciated.
5 REPLIES 5
Message 2 of 6
adadnet
in reply to: Matt S

five years down the line, i've come across very much the same problem.

 

kean walmsley tends to use the solid fill, which seems to avoid the issue altogether, although in one example he mentions setting the hatchpattern.objecttype. unfortunately, i've not noticed any difference myself by doing so, i.e. evaluatehatch(true) still either throws an exeption or it doesn't. even programming values which i used satisfactorily in the drawing, i.e. scale and hatch area, is no guarantee for a pass.

 

the really frustrating thing about this is, that despite the awareness, i still have no idea how to deal with this exception type other than resort to solid fill.

 

matt posted this in 2007, comments welcome

Message 3 of 6
Patch61
in reply to: Matt S

Just a shot in the dark here, but maybe you can evaluate the solid hatch and change the hatch pattern after?

 

Message 4 of 6
mohnston
in reply to: Matt S

I had a similar problem when trying to access the "area" property.

I got this suggestion from Philippe Leefsma.

 

Try specifying the loop as “External” instead of “OuterMost”, that will fix the exception while calculating the area:
acHatch.AppendLoop(HatchLoopTypes.External, acObjIdColl)

 

It solved my problem.

CAD Programming Solutions
Message 5 of 6
adadnet
in reply to: mohnston

i tried a couple of type/scale configurations that did recently throw an exception and it appears that, as you state, specifying 'external' (as opposed to outermost) gets it through. many thanks

Message 6 of 6
NenaOlano
in reply to: Matt S

I had the same problem, I modified scales, angles and more, but the same error appeared, I never knew why. So, I placed EvaluateHacth (false); and "worked" ...  Greetings from Venezuela Smiley Wink

 

Spoiler
Polyline PiedraPicadaFA1 = new Polyline();
PiedraPicadaFA1.AddVertexAt(0, new Point2d(Origen_CorteFA1_X, Origen_CorteFA1_Y), 0, 0, 0);
PiedraPicadaFA1.AddVertexAt(0, new Point2d(Origen_CorteFA1_X, Origen_CorteFA1_Y - Epp), 0, 0, 0);
PiedraPicadaFA1.AddVertexAt(0, new Point2d(Origen_CorteFA1_X + FA1_Bx,  Origen_CorteFA1_Y - Epp), 0, 0, 0);
PiedraPicadaFA1.AddVertexAt(0, new Point2d(Origen_CorteFA1_X + FA1_Bx,  Origen_CorteFA1_Y),         0, 0, 0);
PiedraPicadaFA1.Closed = true;

DibujarModelSpace.AppendEntity(PiedraPicadaFA1); TransaccionActual.AddNewlyCreatedDBObject(PiedraPicadaFA1, true);
PiedraPicadaFA1.ColorIndex = 8;
                        

ObjectIdCollection PiedraPicadaFA1_Obj = new ObjectIdCollection();
PiedraPicadaFA1_Obj.Add(PiedraPicadaFA1.ObjectId);
                        

Hatch PiedraPicadaFA1_Hatch = new Hatch();
DibujarModelSpace.AppendEntity(PiedraPicadaFA1_Hatch);
TransaccionActual.AddNewlyCreatedDBObject(PiedraPicadaFA1_Hatch, true);

PiedraPicadaFA1_Hatch.SetHatchPattern(HatchPatternType.PreDefined, "GRAVEL");
PiedraPicadaFA1_Hatch.Associative = true;
PiedraPicadaFA1_Hatch.AppendLoop(HatchLoopTypes.Outermost, PiedraPicadaFA1_Obj);
PiedraPicadaFA1_Hatch.PatternScale = PiedraPicadaFA1_Hatch.PatternScale - 0.99;
PiedraPicadaFA1_Hatch.SetHatchPattern(PiedraPicadaFA1_Hatch.PatternType, PiedraPicadaFA1_Hatch.PatternName);
PiedraPicadaFA1_Hatch.ColorIndex = 8;
PiedraPicadaFA1_Hatch.EvaluateHatch(false);

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost