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

reading dimension arrows
reading dimension arrows
hello,
i have a problem at reading dimension arrows with following code:
oddmutil::arrowname(pdimensionent->dimblk1());
this returns arrow name, if autocad r14 file is loaded, otherwise no name is returned.
why it does not work also for autocad2000 and 2004 files?
here i have another example, which does not work in any case:
pdimensionent->getdimstyledata(&dimstyle);
oddmutil::arrowname(dimstyle->dimblk1());
dwgdirect reference says, that method getdimstyledata fills dimension style with the style, which is used in the dimension. but this example never returns any name of dimension arrow.
while i could not find similar thread on this forum, i suppose, that i am doing something wrong here. can anybody help me at this problem?
regards, tomaz
have you tried this with different arrow heads? according to autocad's help empty name is default - "closed filled".
btw, note that dimblk1 and dimblk2 are used only if dimsah is on. else dimblk is used for both arrows.
sergey slezkin

hello sergey,
apparently this was my mistake. my application first removes all blocks from the drawing, which are not inserted by insert entity. among those blocks were also blocks of dimension arrows.
this also clarifies, why r14 worked correctly
thanks for a good advice and quick help.
regards, tomaz

hello,
according to autocad's help empty name is default - "closed filled".
btw, note that dimblk1 and dimblk2 are used only if dimsah is on. else dimblk is used for both arrows.
i have a drawing with dimension. left arrow is "open30", right one is "dot"
but when i load it with dwgdirect library, it returns:
dimblk1 = ""
dimblk2 = "dot"
dimblk = "open30"
dimsah = 1
according to previous posts, if dimsah is 1, dimblk1 and dimbl2 are used, otherwise dimblk is used.
so in this case i assume, that something is wrong. is this a bug, or am i missing something?
regards, tomaz
i forgot the file
attached files (37.6 kb, 16 views)

dimension references dimstyle there dimension variables are stored. but it also can have some variables overridden. overrides are stored in dimension entity's xdata.
in your example dimension have dimblk1 override as zero handle.
zero arrow handle in dimstyle data is treated by autocad as closed filled. zero arrow handle in xdata override is ignored by autocad and arrow from dimstyle is used.
dd does not ignore zero arrow handle override in xdata. this is dd bug.
for now it can be bypassed by avoiding setting zero arrow handle to dimension entity.
sergey slezkin

hello sergey,
i have reproduced this problem also with new dwgdirect 1.10 (update 1) library.
is it possible to fix it for the next maintenance release?
best regards, tomaz
this bug will be fixed in 1.11 release. i put some explanations below to clarify it.
for attached drawing (dim123.dwg) ddt returns correct values:
dimblk1() = ""
dimblk2() = "dot"
dimblk() = "open30"
dimsah() = 1
acad arx methods return the same values. but acad has a feature... dbdimension::getdimstyledata(dbdimstyletablerecord *prec) fills prec with the effective style settings currently in use by this dimension. the acad has method prec->arrowid(dimarrowflags) which for "dim123.dwg" returns:
prec->arrowid(db::kfirstarrow) = "open30"
prec->arrowid(db::ksecondarrow) = "dot"
whereas
prec->dimblk1() = ""
prec->dimblk2() = "dot"
prec->dimblk() = "open30"
prec->dimsah() = 1
ddt will have the same method and use it for recomputing dimension. as workaround until 1.11, you can use own function to get first and second arrows:
code:
oddbobjectid blkid;
if (dimsah())
{
blkid = (arrowtype==oddb::kfirstarrow) ? dimblk1() : dimblk2();
}
if (blkid.isnull()) blkid = dimblk();
regards,
sergey vishnevetsky
sergey,
thanks for the reply. i will try to wait for the next release, to get the proper solution. if the release date will be too late, i will implement your workaround.
thanks again.
best regards, tomaz
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】need dimension advice yang686526 DirectDWG 0 2009-05-06 06:20 PM
【转帖】measurement value 9dxf 420 stored in a dimension entity yang686526 DirectDWG 0 2009-05-06 05:32 PM
【转帖】an angular dimension error yang686526 DirectDWG 0 2009-05-04 03:57 PM
【转帖】a dimension error yang686526 DirectDWG 0 2009-05-04 03:05 PM


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


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