高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】objectarx&dummies习题(一)—— creating and editing entities
objectarx&dummies习题(一)—— creating and editing entities
objectarx&dummies习题(一)—— creating and editing entities
lab 1 - creating and editing entities
hello,
our first lab will cover all presented contents since the course beginning. the main idea is to keep this lab simple to consolidate all knowledge present so far.
requirements:
* class 1 to 6;
* autocad 4/5 or compatible vertical installed;
* visual studio .net 2 installed;
* objectarx wizard installed.
objectives:
create a simple objectarx module with 2 commands: cents and chents. the first command will create a simple circle (center on 0,0,0 - radius = 10) and a line (from 0,0,0 to 10,10,0). the second command will prompt user to select an existing entity and then will change its color to 1(red).
instructions:
- create a project called arxlab1 using objectarx wizard;
- click on the a> icon at arxwizard's toolbar to open command dialog;
- right click on the above portion and select new;
- change the global an local name for cents and select modal as command mode;
- repeat the process for the chents command;
- click ok and inspect acrxentrypoint.cpp file to see the two created functions;
- observe that two macro entries were added at the end of this file;
- to select an entity to change its color, use the following procedure (trust me):
ads_name en;
ads_point pt;
if (acedentsel("\nselect an entity: ", en, pt) == rtnorm) {
acdbobjectid eid = acdbobjectid::knull;
acdbgetobjectid(eid, en);
}
tips:
- don't forget to call close() the entities after open or create them;
- explore the code to understand what arx wizard has created for you;
- pay attention to code syntax;
- 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 3 days to accomplish this lab;
- after this period, i will post my suggested solution for this.
|