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

hard-coding style sheet names
hard-coding style sheet names
dear oda gurus, i am presently studying how to load a style sheet in a dwg using dwgdirect 2.4.2.
i have found difficulties with storing a hard-coded style sheet name. i need no interaction with the user, nor i need checking whether any ctb file does exist; i just need storing a file name, so that if the file exists in the proper path specified in the autocad profile, autocad will load it; otherwise, autocad should report "file missing".
when using version 1.14.02, this task was straightforward using oddbplotsettingvalidator::setcurrentstylesheet i.e.
code:
struct myservices : public exsystemservices, public exhostappservices {...}
//myservices m_svcs is declared and properly initialized in my class
//following code in the routine creating the plot setting
oddbplotsettingsptr ps = oddbplotsettings::createobject();
oddbplotsettingsvalidatorptr v = m_svcs.plotsettingsvalidator();
ps->setplotsettingsname(psname);
...
v->setcurrentstylesheet(ps, dd_t("cce.ctb"));
...i have not been succeeding reproducing this behaviour.
i wonder if that routine works differently than before. i retrieved information about ddplotstylepaths as well as plot setting features in odamfcapp, but they do not seem suiting my needs. i am using static linking for my application.
thank you very much for your suggestions in advance.
mirko pontrelli.
last edited by m.pontrelli@coastalexploration.com; 11th december 2008 at 07:47 amfff">. reason: mistakes
still searching for a solution
back on the topic after some months and switching to dd 2.7.1. i can't grasp what i am missing yet.
basically, after this code
code:
odresult res = v->setcurrentstylesheet(pplotsettings, odstring("test.ctb"));
odstring test = ps->getcurrentstylesheet();the value of res is einvalidinput and, subsequently, test is empty.
odamfcapp also put it that way:
code:
void cpagesetupdlg:nselchangeplotstylefiles()
{
int idx = m_comboplotstylefiles.getcursel();
getdlgitem(idc_pagesetup_button_plotstylefiles)->enablewindow( idx );
if (idx)
{
cstring tmp;
m_comboplotstylefiles.getlbtext(idx, tmp);
m_pvalidator->setcurrentstylesheet(&m_params, odstring(tmp));
}
else
{
m_pvalidator->setcurrentstylesheet(&m_params, odstring::kempty);
}
}using oddbplotsettingsvalidator::refreshlists() does not work, even if the ddplotstylepaths is properly set. does setcurrentstylesheet() check for the actual existence of the ctb file in the plot style list? that would be most annoying for my target.
the problem seems similar to this one:
quote:
originally posted by sjaiswal@hachisoft.com
hi,
my drawing has one *.ctb plot style associated with model layout. i want to remove this association and set it to empty.
currently oddbplotsettingsvalidator::setcurrentstylesheet() returns einvalidinput result when passing odstring::kempty as stylesheet name.
is there any other way to remove currently associated plotstyle from a layout?
thanks.
mr. slezkin suggested using oddbentget and oddbentmod methods as a workaround to one of dd bugs, but more than one year has passed since then. it requires module loading, which in turn requires touching the main application file. i would prefer not to apply that solution, in order to keep my code clean: i just use dd to serialize dwg files, and i would keep everything involving it in a separate application "branch".
by the way, i didn't manage to succefully use that suggestion. i took information about odplotsettingsvalidatormodule, odbagfiler and tasks involved by such modules. i guess that's because i have no familiarity with dd modules - i did't need them before.
other solutions seem making the task more complex, rather than easier.
so, before spending some more time with modules and other "exotic" ways: do i really need them? adding the dotted pair (7 . "test.ctb") to the plot setting list ?la-lisp is all i need, regardless whether that file is present or not; nor i need to vectorize anything with my application. with dd 1.14.02, it was really a one-line task. i currently use class oddbplotsettingsvalidator to set every other plot setting parameter, and it works flawlessly.
regards,
mirko pontrelli.
last edited by m.pontrelli@coastalexploration.com; 3rd april 2009 at 03:41 amfff">.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】error c2664 yang686526 DirectDWG 0 2009-05-05 09:34 AM
【转帖】drawing rev varies, sheet by shee yang686526 American standards 0 2009-04-29 07:47 PM
【转帖】哪位高手指点一下下边lisp的怎么用 yang686526 数据库ObjectDBX 0 2009-04-28 12:13 PM
哪位高手指点一下下边lisp的怎么用 yang686526 ObjectARX(AutoLISP) 0 2009-04-26 06:19 PM
【转帖】asme美国机械工程师标准目录2 huangyhg American standards 5 2009-04-26 02:38 PM


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


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