高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】gipolylinehaswidth vs. getconstantwidth
gipolyline::haswidth vs. getconstantwidth
gipolyline::haswidth vs. getconstantwidth
i've found that gipolyline::haswidth returns false even if a polyline has a constant non-zero width. is it normal behavior?
thanks
arno歵
haswidth() returns true if vertices have individual widths.
sergey slezkin
hi,
i've noted that for a simple rectangle made in autocad for which haswidth() returned false, getconstantwidth() returns 0, whereas the lineweight applied to the rectangle was non-zero.
what does this case (haswidth() == false && getconstantwidth() == 0) signify?
my current understanding is that for getting correct lineweight in plineproc() i'll have to do something like:
code:
if (!lwbuf.haswidth())
{
if (lwbuf.getconstantwidth() == 0)
{
// fetch the lineweight stored in the last call to ontraitsmodified()
}
else
{
lineweight = lwbuf.getconstantwidth();
if (pxform)
{
lineweight * = pxform->scale();
}
}
}
thanks,
varun
lineweight and polyline width are unrelated things.
lineweight is common oddbentity property. any entity can have lineweight (paper line width).
oddb2dpolyline and oddbpolyline can have constant width or width specified per each vertex (haswidths() = true).
for example polyline with 2 vertices one of which has zero width and another - non-zero width is rendered as triangle.
polyline width is in model coordinates.
sergey slezkin
for a rectangle, each of whose's edges have the same lineweight, why does the getconstantwidth return zero?
thanks,
varun
lineweight and polyline's width are unrelated things.
sergey slezkin
|