几何尺寸与公差论坛------致力于产品几何量公差标准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-07, 12:12 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】question about oddbhatch

question about oddbhatch
question about oddbhatch
i can obtain the hatch pattern definition for this hatch entity as it appears in the pat file with getpattern or obtain the specified pattern definition line for this hatch entity with getpatterndefinitionat
is it possibile set pattern into oddbhatch from pattern definition line?
i am looking for something like "setpatterndefinitionat".
pattern definition can be set using one of setpattern() or setrawpattern() functions.
it's impossible to change individual line in pattern.
sergey slezkin
ok thank's you a lot.
is it possible convert odhatchpattern as in dxf file
53 pattern line angle
43 pattern line base point, x component
44 pattern line base point, y component
45 pattern line offset, x component
46 pattern line offset, y component
79 number of dash length items
49 dash length (multiple entries)
into pat file?
dd contains code reading .pat files but no .pat writing code.
btw, it's rather trivial to write .pat file. it has very simple text format.
sergey slezkin
while we are on the pattern subject, may i ask the the following question :
the documenttion says that calling phatch->getpattern()
"...returns the hatch pattern definition for this hatch entity as it appears in the pat file...."
this does not look true:
in the ac .pat iso file, the angle definition is
0.0000,0,0,0.0000,6.9850,5.0800,-1.9050
90.0000,0,0,0.0000,6.9850,5.0800,-1.9050p
but getpattern() return this :
0.0000,1.5593,0.4197fff">,0.0000,6.9850,5.0800,-1.9050
90.0000,1.5593,0.4197fff">,0.0000,6.9850,5.0800,-1.9050
that is there is an originx and originy value. added to the definition.
it is not the orginx/y that is given int the hatch properties
how is this point calculated ?
thanks
hatch pattern stored in the hatch entity is scaled and rotated according to hatch entity properties.
getpattern() removes scale and rotation from pattern returned. but it does not remove origin. this is dd bug. thanks for noticing it.
but note that hatch origin point was introduced in autocad 2006.
previous autocads did not store the origin point in hatch entity. while creating hatch entity they used as origin current ucs origin so pattern in pre-ac2006 may be offset. in such case (if origin is non-zero) it's impossible to remove offset if the file is created in ac14-ac2005.
sergey slezkin
thank you serguey. i use ac2007 for my testing purposes.
try to do your best to fix this in the march release !
if i understand you well :
with pre ac2006 dwg file phatch->getpattern() will contain an offset
with post ac2005 dwg file phatch->getpattern() will return the pure pattern definition ( when you fix the dd bug )
please confirm !
this is important for us to know, because having the pure definition, we can add it to our pattern list in our software !
yes, but the key thing with versions is not autocad's version which saved the file but autocad's version in which the hatch entity was created.
for example:
a hatch entity is created in ac2005 and saved to file.
file is opened by ac2006 and resaved.
hatch offset will not be saved.
original file version also can't help. because a hatch entity can be created later by another ac version:
drawing is created by ac2006
file is opened by ac2005 and hatch is created
original drawing version and "last saved by" version are ac2006 but offset is not saved for hatch entity.
btw, dwg of ac2004-ac2006 have the same file format. hatch offset is saved as xdata by ac2006 and ac2007.
sergey slezkin
interesting !...
pdb->originalfileversion() returns what ? the version of ac who created the file
or the version of the ac who saved that file last ?
so, if pdb->originalfileversion() (hopefully) returns the version of ac who created the file originally, then i can dig into xdata for pre ac2006 hatches to retrieve the hatch offset and substract it to retrieve the pure hatch definition. right ?
while we are talking of original dwg, how can i konw if a dwg that has been read in a db comes from autocad ( trusted?) or from another software?
thanks
oups !!! i think i misread your answer...
i understand now that for pre ac2006 files, there is now way to retrieve the hatch offset ( and then i can't strip it from the pattern definition...
.... and therefore i cant get the pure pattern definition for pre ac2006 created files.
right ?
right. but about hatch entity, not about file.
if hatch is created in ac2006 it has offset xdata attached.
if hatch entity is created in ac2005 it has no offset xdata.
imagine: file is created in ac2006 and saved.
file is opened in ac2005 and hatch entity is created (no xdata)
file is opened in ac2006 and saved.
neither original file version nor last saved by will help.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】origin point of an oddbhatch yang686526 DirectDWG 0 2009-05-06 09:31 PM
【转帖】oddbhatch and xor-ed polygons yang686526 DirectDWG 0 2009-05-06 07:46 PM
【转帖】how obtain base item of oddbhatch yang686526 DirectDWG 0 2009-05-05 12:32 PM


所有的时间均为北京时间。 现在的时间是 05:03 PM.


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