几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » ObjectARX(C++)
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-04-16, 10:33 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】objectarx&dummies习题(三)—— creating a custom object

objectarx&dummies习题(三)—— creating a custom object
objectarx&dummies习题(三)—— creating a custom object
lab 3 - creating a custom object
hello,
our third lab will cover custom objects. you will need to create a custom object, its properties, functions and dictionary related methods.
requirements:
* class 1 to 12;
* autocad 4/5/6 or compatible vertical installed;
* visual studio .net 2 installed;
* objectarx wizard installed.
objectives:
the main idea is to create the first part of a complete custom shape application. this part consist of building the custom object which will represent the shape form with properties that allows you to completely define it.
the second step will be the custom entity which will refer to its associated shape. as several entities may use the same shape it is not a good idea to repeat the shape information inside each entity. exactly due that we will create this custom object which will store de shape information and share this information with all custom entities related to it.
it will be an "i" shape with equal top and bottom flanges and it will need to store the following information:
-web height (d) - double;
-web thickness (tw) - double;
-flange width (bf) - double;
-flange thickness (tf) - double;
-shape name (desig) - cstring;
instructions:
- you will create two projects. the first, called shapesui (which will be the objectarx module) and the second called shapesobj (which will be the objectdbx module)
using objectarx wizard;
- enable using mfc option in both projects;
- after created both projects, open the autodesk view toolbar , select the shapesobj project and create the custom object called shapeobject;
- override filling functions (dwgoutfields / dwginfields);
- implement all necessary properties to this object and provide is persistence through dwg filling functions;
- create two functions. one to create the object and stored it inside nod and other to list all existing objects. use your custom dictionary as shapeapp;
- use "*" as the key name of each shape inside shapeapp dictionary;
- create a research function which will receive the shape information and will lookup an existing shape that matches with the information. if it is found, return it's objectid instead of create a duplicated shape. if it is not found, create a new shape and return its brand new objectid;
- don't forget to create a == operator for your class to make easy to compare shapes when researching the dictionary;
tips:
- use the class 12 code fragment to help you with this project;
- add properties using arxwizard because it will create the access methods and will put the filling line at dwginfields() and dwgoutfields() functions;
- be careful about code flow inside dictionary manipulation functions;
- double check your open / close scopes;
- test save and open the dwg to assert that the custom objects are successfully saved and loaded;
- use arxdbg to verify if your custom objects are placed into the right place;
- use the objectarx documentation when necessary;
support:
if you have any questions please post your issue on this article to share with others.
expected time:
- i will give you 7 days to accomplish this lab;
- after this period, i will post my suggested solution for this.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】custom properties yang686526 SolidWorks二次开发 0 2009-04-13 10:09 AM
【转帖】custom properties for multiple part configurations yang686526 SolidWorks二次开发 0 2009-04-13 10:08 AM
【转帖】creating a custom menu for 2008 yang686526 SolidWorks二次开发 0 2009-04-13 10:03 AM
【转帖】custom properties bom --- yang686526 SolidWorks二次开发 0 2009-04-12 08:36 PM


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


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