高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】hatch names, oddbhatchsetpattern
hatch names, oddbhatch::setpattern
hatch names, oddbhatch::setpattern
hi,
oddbhatch::setpattern throws an exception if hatch pattern name is something like brick,_o (132, bad name for hatch pattern). acad accepts pattern names like this, see attached sample file.
does name check depend on the type of the pattern ?
- jukkas
attached files
this exception means that pattern "brick" is unknown to pattern manager.
hatch patterns can be of 3 types:
user defined - simple hatching which is completely defined by oddbhatch methods setpatternspace(), setpatternangle() and setpatterndouble() no pattern manager and .pat files are required in this case.
custom defined and predefined patterns are described in .pat files.
predefined patterns reside in acad.pat file for english drawings and in acadiso.pat for metric ones.
custom defined pattern must be described in file <patternname>.pat
dd's pattern manager loads the patterns from .pat file. but where is an option to avoid using .pat files - adding the patterns to pattern manager programmatically - oddbhatchpatternmanager::appendpattern().
if pattern description presents in setpattern() where is no need in pattern manager.
odwriteex sample contains code illustrating different ways of specifying
hatch pattern.
sergey slezkin
sergey,
i've allmost managed to write all hatch types. but, it looks like setpattern may change the type of the hatch ?
i've created a pattern, given it to pattern manager using appendpattern. if hatch style is set to knormal before setpattern, it is kouter after the call (pattern is red from an hatch, which originally had kouter style).
also, hatch does not display in acad, if style is kouter, until style is changed to normal. but if i set the style to knormal after setpattern, hatch is displayed.
all example code in odwriteex seems to be using knormal. also, it is set after setpattern is called. is this the way setpattern / sethatchstyle should be used ?
- jukkas
setpattern() forses hatch to be outer or ignore if pattern name has _o or _i suffix.
brick,_o means:
name - brick
style - outer
hatch with outer island detection style may be not displayed because of loop types.
outer hatch covers area between external and outermost loops.
sergey slezkin
sergey,
many thanks. seems that code that writes the loops need checking, the problem with kouter - style was fixed when i changed style in appendloop from kdefault to kexternal.
if there any documentation that describes how different flags for appendloop are used and how loops should be written ? there is not much information in odwriteex.
- jukkas
|