几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-05, 11:55 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】hatch patterns

hatch patterns
hatch patterns
hello,
i have a few questions regarding hatch patterns in new dwgdirect library.
1.
can kuserdefined patterns be added with method appendpattern(...)?
i made similar example as in file dbfiller.cpp for creating custom hatches (stars), with one main difference. i created kuserdefined hatch pattern intead of kcustomdefined.
pattern was not the same any more. only lines (no stars) were in the pattern.
2.
if i add two different patterns with the same name (appendpattern()), will second definition overwrite the first one?
regards, tomaz
hello,
i have one additional question to this subject:
if i create one kcustomdefined hatch pattern and use it with a hatch (like stars in your example).
autocad does not allow to change any property of this hatch pattern. i suppose, that this happens, while it does not have the pattern definition? is it possible to save also pattern definitions into dxf/dwg file, or is this a limitation of autocad (dxf/dwg)?
regards, tomaz
kuserdefined patterns need no definition. such patterns are simple hatching or cross hatching. they are completely defined by angle, spacing and 'cross' flag.
autocad assums that:
1. predefined patterns are stored in acad.pat or acadiso.pat depending on drawing's measurement (metric or english).
2. custom pattern is stored in separate file <pattern_name>.pat
these files must be available for autocad via its support paths.
actually hatch pattern is stored inside each hatch entity (in scaled and rotated form). but autocad requires access to pattern definition in "pure" form (not scaled and rotated).
sergey slezkin
thanks sergey.
this clarifies my problems with hatches.
regards, tomaz
hello sergey,
i have another question regarding hatches.
is there any simple way, to save the custom pattern into file with dd library?
for example, if i create a custom pattern (like in dd examples - stars), is it possible to save this pattern into output file from dd library?
best regards, tomaz
currently dd can't write .pat files.
sergey slezkin
hi sergey,
i have some patterns in a dwg file. i use odhatchpatternmanager to get the pattern definition:
result = patternmanager->retrievepattern(patterntype,patternname,oddb::met ric,pattern);
it returns an error code: kkeynotfound.
when i use the dd example and create the stars pattern then retrieve it, the pattern is found.
can you tell me what's wrong?
is there any way of listing all pattern definitions in a file?
thank you.
pattern definitions are not stored in dwg file in a table or a dictionary like dimstyles or multiline styles. autocad stores patterns in .pat files. each hatch entity store transformed pattern inside it (scaled and rotated). dd does not collect patterns from hatch entities into some table (and autocad too).
where are 2 ways to make a pattern known to pattern manager: load from .pat file or create programmatically like in odwriteex sample.
sergey slezkin
thank you sergey,
but how can i load patterns from a .pat file to the pattern manager? i couldn't see it in any example or function call.
regards,
oddbwriteex contains example of creating hatches with different patterns (dbfiller.cpp - dbfiller::addhatches())
if a pattern is set to hatch entity by name dd will fill all necessary data itself.
if for some purpose you need access to pattern data from .pat file you can use interface declared in hatchpatternmanager.h
predefined patterns are supposed to be stored in acad.pat or acadiso.pat depending on measurement. custom pattern - in .pat file with the same as pattern name.
to get *.pat files dd calls oddbhostappservices::findfile().
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】exported hatch patterns dot appear in acad yang686526 DirectDWG 0 2009-05-05 10:29 AM
【转帖】dimensioning repeated hole patterns yang686526 American standards 0 2009-04-29 07:34 PM
【转帖】angular 9timing0 orientation of 2 different patterns yang686526 American standards 0 2009-04-29 06:20 PM
【转帖】using sheet metal to make cardboard box flat patterns yang686526 SolidWorks二次开发 0 2009-04-13 03:11 PM
【转帖】edit dimensions within patterns yang686526 SolidWorks二次开发 0 2009-04-12 08:46 PM


所有的时间均为北京时间。 现在的时间是 01:27 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多