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

oddbline thickness
oddbline thickness
hi!
i'm using 1.8 version of dwgdirect! i need to trace into my draw lines with variable thickness! i tryed the "setthickness" instruction but the only effect (may be a bug) i have is that if i draw my lines in a block, when i put a block reference on the model space all the other entities are covered by the block with the lines!!!! i tried several times and i'm sure that the effect made by the set thickness! so i searched other ways but i found only the follows:
odgidrawabletraits traits;
traits.setlineweight(getnearestvalue(th));
oduint32 er = pline->setattributes(&traits);
...
unfortunately it doesnt compile and i didn't find any example that can help me!
any help is welcome
regards
thickness does not effect line width. example: circle with non-zero thickness is a cylinder.
pline->setattributes(traits) sets attributes from line to traits.
try pline->setlineweight();
sergey slezkin
hi sergey
i tried in several manners but it seems that the line is with every kind of value the same !!!!
any idea?
let's start from the beginning. what is your goal? to create a dwg file with lines having different widths?
or to display existing drawing taking line weights into account?
sergey slezkin
hi!
i have to create a draw on the fly with lines that have different width! after i have created it i must display it on the screen or print it on the paper! the problem is that i have created the lines i putted it on the screen but i'm not able to see the width of the line!!! on the screen and on the paper they have the same appearance even if i have drawn it with different width values! look the saved dwg file included
thanks
mrspock
attached files (10.3 kb, 4 views)

in file attached lwdisplay variable is off so lineweights are not displayed.
sergey slezkin
after many retray the results
hi sergey i'm thinking that i'm not able to understand all the scene, well i putted the lwdisplay on but when i make the primitives on the display they appears like you can see in "sottile.jpg" after i saved the draw generated and i reload it not only with odamfcapp but also with my program it appears like in "spesso.jpg" i included also the "managia.dwg" it may be i have omitted something in the creation of the display?
thanks
mrspock
attached files (74.7 kb, 7 views)

are you satisfied how the dwg file is displayed in autocad?
if so:
odamfcapp display picture is produced by opengl device. the "thick" cross appears as a square because round caps for thick lines are not implemented in odamfcapp device. wingdi device renders the cross exactly as autocad.
your application renders cross with thin lines because your device does not honor lineweight property from traits.
sergey slezkin
misunderstanding
hi sergey
what does it means "your application renders cross with thin lines because your device does not honor lineweight property from traits." ? i'm sorry but really i don't understand!
bye
spesso.jpg - screenshot of odamfcapp is ok. "+" symbol in the center of the screen is drawn with thick lines.
you also posted sottile.jpg - a screenshort of odttest application.
in odttest screenshot "+" is rendered with thin lines. odttest does not take into account lineweight. like color lineweight is one of rendering properties.
sergey slezkin
explainations
hi sergey
it may be my english is not so good so you are not able to understand me, and also i'm not able to understend fine what you means. i'll try anoter time:
-) i builded an application called odttest, this application is capable in load and save dwg drawings with opendwg library, not only i have implemented a function that can draw on an empty database some cross.
-) in the first step i build the cross on the empty database (with also some strings etc.) they appears as you can see in sottile.jpg
-) in the second step i save the draw calling it managia.dwg
-) third step i load the draw with odamfcapp and it appears like you can see in spesso.jpg
-) fourth step i load managia.dwg on odttest and the draw appears identical in spesso.jpg
so my question is why, if the display device is generated by the same code in odttest, if i put the lines myself on the draw it doesnt display the thickness otherwise, i load the same lines i can see the thicness? whats wrong what i forget?
thanks
my english is far from ideal. if i understood you correctly the file your application saves (with thick lines added) is ok. it's correctly displayed by ac and by your application after it is saved and reloaded. but newly created lines (before saving to file) are displayed without lineweight. correct?
are you sure you set lwdisplay? or maybe it's turned on only before saving the drawing?
sergey slezkin
hello mrspock
can you send me the code you have - i'll see if i can fix it for displaying varying line weights for you.
walt (support@opendwg.org)
i'm sure
you have understand, and i'm sure that the flag lwdisplay is on before i trace the cross!
if you think i'll send the code.
i'll tryed in opengl and gdi way with the same results
odamfcapp contains creating a line entity sample - the right most button of toolbar in render window (both gdi and gl).
i added to dwgviewer.cpp (there line entity is created) the following code:
pline->setlineweight(oddb::klnwt200);
pdb->setlwdisplay(true);
and the line gets created and rendered in odamfcapp with non-zero lineweight - "thick"...
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】is it possible that make different thickness of each color o yang686526 DirectDWG 0 2009-05-06 04:13 PM
【转帖】how to change thickness of ttf te yang686526 DirectDWG 0 2009-05-06 02:20 PM
【转帖】font thickness in pdf expor yang686526 DirectDWG 0 2009-05-05 11:03 AM
【转帖】flatness relative to part thickness yang686526 American standards 0 2009-04-29 07:59 PM


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


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