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

missing attributes
missing attributes
hello
i am trying to copy all of the model space entities of sourcedatabase into the model space of m_pdatabase.
the following function achieves this except that it fails to
put attributes onto any of the block inserts that are copied. the
block definition created does however contain the attribute definitions.
what am i doing wrong?
bool copyentities( oddbdatabaseptr sourcedatabase, odgevector3d inspt )
{
try {
odgematrix3d transformation;
transformation.settranslation( inspt ) );
m_pdatabase->insert( transformation, sourcedatabase );
}
catch( oderror e )
{
return displayerror( e.code() );
}
}
thanks in advance
what you are doing is correct. i just tested it out in the distributed version with success.
perhaps you can send me the drawing that you are attempting to insert? i might be a missing font in the tables - hard to say. but i was successful with inserting a drawing which contained a block with attributes.

hello
i have determined that the insert command mentioned in my previous post seems unable to deal with complex entities such as attributes and 3d polylines.
to observe this behaviour please do the following:
make a new drawing file using autocad 2004
construct a 3d polyline entity using the 3dpoly command in autocad.
use the autocad insert command to insert a block with attributes into the same drawing file. fill in the attributes with something
so they are visible.
finally make a simple line entity and a text entity in the drawing.
now if you run the function mentioned in my previous post on this drawing file you will see that the text entity and line entity will have copied correctly. however the 3d polyline and the attributes on the block
will be missing.
i would be very grateful if you could try this as it is causing me a lot of trouble.
thankyou
ashman
since you've gone through the trouble of creating that a very specific drawing - could you post it here?
hello
here are some drawing files as requested.
there are three files as described below:
"block.dwg"
this is a block with a text entity and two attribute definitions
"drawing to insert.dwg"
this is a drawing with block.dwg inserted into it using the autocad insert command. this drawing also contains a text entity, line entity and a 3d polyline entity.
"drawing inserted.dwg"
this drawing is produced when dwgdirect is used to insert "drawing to insert.dwg" into a new drawing file.
note that the attributes of the block and the 3d polyline entity are missing.
i hope this helps.
kind regards
ashman
attached files (19.7 kb, 4 views)

i just used the odwriteex example and the drawing you gave me "drawing to insert.dwg" -
i've attached the resultant drawing as well as my modified odwriteex example that you can paste into your examples folder for verification.
attached files (16.1 kb, 4 views)

i have compiled your code in the odwriteex example using vc6 and run it to produce the attached drawing. unforuntately it has exactly the same problem as i had before. why it works on your computer is a mystery. perhaps you are running a different version. i am using version 1.09 of dwgdirect and visual studio 6 sp5.
thanks for your help
regards
ashman
attached files (107.8 kb, 2 views)

i appears that the reason for my trouble is that the version of the library i am using is not the same as the one currently available. i have downloaded it again and compared the files and there are significant differences. it was called 1.09 when i downloaded maybe it is not actually the same 1.09 currently available?
anyway it all seems to work fine now.

happy are we!!
hi
sad are we!!
unforuntately i have discovered a problem that is not fixed by my previous discovery. if a block is inserted 'n' times into a drawing file the block definition will contain 'n' copies of all the entities that make up the block. to observe this behaviour you could use the obwriteex that you sent me previously and substitute the following version of copyentities which will insert the drawing "drawing to insert" in three places.
bool copyentities( myservices &svs, oddbdatabaseptr &pdb )
{
try {
odgematrix3d transformation;
odgevector3d inspt(0.0 , 0.0 , 0.0);
transformation.settranslation( inspt ) ;
oddbdatabaseptr sourcedatabase = svs.readfile( "c:\\opendwg2004\\examples\\odwriteex\\drawing to insert.dwg" );
pdb->insert( transformation, sourcedatabase );
inspt.x = 10;
transformation.settranslation( inspt ) ;
pdb->insert( transformation, sourcedatabase );
inspt.x = 20;
transformation.settranslation( inspt ) ;
pdb->insert( transformation, sourcedatabase );
}
catch( oderror e )
{
}
return true;
}
once you have run this go to the odamfcapp and open the drawing that is produced. go to the <block> key in the tree and you will see that there are three copies of every entity in the block definition of the inserted block.
apparently this is a bug. i'll forward this on to the engineers as this one looks complex to deal with.
hi again
i see that the 18-11-2003 release has not fixed the bug. any idea of when it may be fixed?
ashman
circle getgeomextents incorrect
hello
the getgeomextents function fails to correctly calculate the bounding box for a circle entity. it returns a box that is the top half of the circle. this is a big problem when trying to calculate the overall extents of a block containing circles.
regards
ashman
thanks for finding it out. circle extents will be fixed in next release.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】looking for info on attributes yang686526 DirectDWG 0 2009-05-06 05:20 PM
【转帖】incorrect block with attributes yang686526 DirectDWG 0 2009-05-06 03:47 PM
【转帖】attributes in dwf expor yang686526 DirectDWG 0 2009-05-04 04:24 PM
【转帖】attributes in a block a not shown at the correct position yang686526 DirectDWG 0 2009-05-04 04:23 PM


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


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