![]() |
【转帖】请教大侠:如何将变量的值以字符串的形式显示
请教大侠:如何将变量的值以字符串的形式显示
请教大侠:如何将变量的值以字符串的形式显示 请教大侠,如何将变量的值在cad绘图界面中以字符串的形式显示出来? 这个问题涉及到变量的转换,各种类型变量转换成字符串方法不一样,转换成字符串后再添加数据库中,下面是添加文字的函数,如果你看不懂的话,多看多做arx中sample下面的例子,多试几次.. acdbobjectid createtext(acgepoint3d pt,cstring strtext, char *pstylename,double height,double dwidth, double rotation,char *playername,acdb::textvertmode vmode, acdb::texthorzmode hmode) { acdbtextstyletable *ptextstyletable; acdbobjectid objid,styleid; char text[255]; acdbhostapplicationservices()->workingdatabase() ->getsymboltable(ptextstyletable, acdb::kforread); if (!ptextstyletable->has(pstylename)){ ptextstyletable->close(); createtextstyle(pstylename,"romanc.shx","hzdx.shx",height,1.0,0.0,1.0); acdbhostapplicationservices()->workingdatabase() ->getsymboltable(ptextstyletable, acdb::kforread); } if (ptextstyletable->has(pstylename)){ ptextstyletable->getat(pstylename,styleid,adesk::kfalse); //′′?¨??×? acdbblocktable *pblocktable; acdbhostapplicationservices()->workingdatabase() ->getsymboltable(pblocktable,acdb::kforread); acdbblocktablerecord *pspace; pblocktable->getat(acdb_model_space,pspace,acdb::kforwrite); pblocktable->close(); strcpy(text,strtext); acdbtext *ptext = new acdbtext(pt,text,styleid,height,rotation); if(dwidth != 1.0)ptext->setwidthfactor(dwidth); ptext->setlayer(playername); ptext->setverticalmode(vmode); ptext->sethorizontalmode(hmode); ptext->setalignmentpoint(pt); pspace->appendacdbentity(objid,ptext); ptext->close(); pspace->close(); pblocktable->close(); ptext = null; } ptextstyletable->close(); return objid; } 下面贴一个别人写的数据转换的例子: 作者:程佩君 刚接触vc编程的朋友往往对许多数据类型的转换感到迷惑不解,本文将介绍一些常用数据类型的使用。 我们先定义一些常见类型变量借以说明 int i = 100; long l = 这个问题涉及到变量的转换,各种类型变量转换成字符串方法不一样,转换成字符串后再添加数据库中,下面是添加文字的函数,如果你看不懂的话,多看多做arx中sample下面的例子,多试几次.. acdbobjectid createtext(acgepoint3d pt,cstring strtext, char *pstylename,double height,double dwidth, double rotation,char *playername,acdb::textvertmode vmode, acdb::texthorzmode hmode) { acdbtextstyletable *ptextstyletable; acdbobjectid objid,styleid; char text[255]; acdbhostapplicationservices()->workingdatabase() ->getsymboltable(ptextstyletable, acdb::kforread); if (!ptextstyletable->has(pstylename)){ ptextstyletable->close(); createtextstyle(pstylename,"romanc.shx","hzdx.shx",height,1.0,0.0,1.0); acdbhostapplicationservices()->workingdatabase() ->getsymboltable(ptextstyletable, acdb::kforread); } if (ptextstyletable->has(pstylename)){ ptextstyletable->getat(pstylename,styleid,adesk::kfalse); //′′?¨??×? acdbblocktable *pblocktable; acdbhostapplicationservices()->workingdatabase() ->getsymboltable(pblocktable,acdb::kforread); acdbblocktablerecord *pspace; pblocktable->getat(acdb_model_space,pspace,acdb::kforwrite); pblocktable->close(); strcpy(text,strtext); acdbtext *ptext = new acdbtext(pt,text,styleid,height,rotation); if(dwidth != 1.0)ptext->setwidthfactor(dwidth); ptext->setlayer(playername); ptext->setverticalmode(vmode); ptext->sethorizontalmode(hmode); ptext->setalignmentpoint(pt); pspace->appendacdbentity(objid,ptext); ptext->close(); pspace->close(); pblocktable->close(); ptext = null; } ptextstyletable->close(); return objid; } 下面贴一个别人写的数据转换的例子: 作者:程佩君 刚接触vc编程的朋友往往对许多数据类型的转换感到迷惑不解,本文将介绍一些常用数据类型的使用。 我们先定义一些常见类型变量借以说明 int i = 100; long l = 这个问题涉及到变量的转换,各种类型变量转换成字符串方法不一样,转换成字符串后再添加数据库中,下面是添加文字的函数,如果你看不懂的话,多看多做arx中sample下面的例子,多试几次.. acdbobjectid createtext(acgepoint3d pt,cstring strtext, char *pstylename,double height,double dwidth, double rotation,char *playername,acdb::textvertmode vmode, acdb::texthorzmode hmode) { acdbtextstyletable *ptextstyletable; acdbobjectid objid,styleid; char text[255]; acdbhostapplicationservices()->workingdatabase() ->getsymboltable(ptextstyletable, acdb::kforread); if (!ptextstyletable->has(pstylename)){ ptextstyletable->close(); createtextstyle(pstylename,"romanc.shx","hzdx.shx",height,1.0,0.0,1.0); acdbhostapplicationservices()->workingdatabase() ->getsymboltable(ptextstyletable, acdb::kforread); } if (ptextstyletable->has(pstylename)){ ptextstyletable->getat(pstylename,styleid,adesk::kfalse); //′′?¨??×? acdbblocktable *pblocktable; acdbhostapplicationservices()->workingdatabase() ->getsymboltable(pblocktable,acdb::kforread); acdbblocktablerecord *pspace; pblocktable->getat(acdb_model_space,pspace,acdb::kforwrite); pblocktable->close(); strcpy(text,strtext); acdbtext *ptext = new acdbtext(pt,text,styleid,height,rotation); if(dwidth != 1.0)ptext->setwidthfactor(dwidth); ptext->setlayer(playername); ptext->setverticalmode(vmode); ptext->sethorizontalmode(hmode); ptext->setalignmentpoint(pt); pspace->appendacdbentity(objid,ptext); ptext->close(); pspace->close(); pblocktable->close(); ptext = null; } ptextstyletable->close(); return objid; } 下面贴一个别人写的数据转换的例子: 作者:程佩君 刚接触vc编程的朋友往往对许多数据类型的转换感到迷惑不解,本文将介绍一些常用数据类型的使用。 我们先定义一些常见类型变量借以说明 int i = 100; long l = |
| 所有的时间均为北京时间。 现在的时间是 06:24 AM. |