查看单个帖子
旧 2009-05-05, 11:50 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】hatch creation

hatch creation
hatch creation
i have oddb entity and want to create hatch for those entity .. could any one please guide me how to do that in vc++ with a small sample code.
thanks in advance
i can tell you how to make a solid hatch.
iacadlwpolyline pline = null;
try
{
double[] trimmedvertices = trimverticelist(vertices); // remove last point if it is equal to first point.
pline = acdocument.modelspace.addlightweightpolyline( trimmedvertices);
if (vertices.length >= 4 * 2) // only hatch things that actually has an area
{
pline.closed = true;
iacadentity[] outerloop = new iacadentity[1];
outerloop[0] = pline;
iacadhatch currenthatch = acdocument.modelspace.addhatch( (int)acpatterntype.achatchpatterntypepredefined,
"solid",
true,
system.runtime.interopservices.varenum.vt_error);
currenthatch.appendouterloop(outerloop);
currenthatch.visible = true;
currenthatch.evaluate();
}
}
catch (exception come)
{
system.console.writeline(come);
}
to make a non-solid hatch i try to use "ansi31", but patternspace fails (see other thread):
iacadhatch currenthatch = acdocument.modelspace.addhatch( (int)acpatterntype.achatchpatterntypepredefined,
"ansi31",
true,
system.runtime.interopservices.varenum.vt_error );
currenthatch.appendouterloop(outerloop);
currenthatch.patternangle = 0;
currenthatch.patternspace = double.parse(exporthatchdenseness);
//currenthatch.patternscale = double.parse(exporthatchdenseness) * 100;
currenthatch.visible = true;
currenthatch.evaluate();
pattern name for userdefined
a colleague of mine figured this out: use "_user" instead of "ansi31".
best regards
michael
thank you very much
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)