![]() ![]() In today’s tests we are drawing 10,000 entities in the same time it took 8 years ago. At that time these test routines were only drawing 2000 entities. Note: This is a partial repeat post from 2007 on our old site. Keep in mind that these numbers are relative and will vary depending on the system. On the other hand, if your code is drawing thousands of entities, you might consider converting your code to use (entmake) where possible. Just make sure you disable command echoing. In summary, if you are only drawing a few entities, or even a few dozen, you won’t notice any difference using (command) as opposed to the other methods. If you disable command line echoing, the (command) function time is cut in half. So (entmake) is the fastest method, and even though (vla-add…) takes about 6X as long as entmake, it is still about 10X faster than using the (command) function when command echoing is enabled. Test 4 – 1.10 Seconds Uses the (vla-add…) function Test 3 – 0.17 Seconds Uses the (entmake) function. Test 2 – 5.20 Seconds Uses the (command) function with CMDECHO set to 0 and NOMUTT set to 1 (this basically turns the command line off…) Test 1 – 11.3 Seconds Uses the (command) function with CMDECHO set to 1 The test constructs 10,000 line entities using various methods. I put together some tests with the help of many others, to compare the (command) function to two other methods of entity creation, (entmake) and (vla-add…). The program allows you to edit and save your work with high precision, it can read DWG and DXF files and it has support for hatch patterns (loading PAT files), block explorer palette, five dimension types (aligned, linear, angular, radius, diameter), LISP enabled and international characters. ![]() However, if you are working on a large program that constructs a lot of drawing entities, you may have wondered why the routine runs fairly slow. There is certainly nothing wrong with that. "AcDbMText") Identifies the entity as MTEXT.If you program with autolisp, you have probably used the command function at some point, probably to construct drawing entities. BabaCAD is a CAD application that offers you practical tools to make technical designs and drawings. "AcDbEntity") Required for all post-R12 entities. For example, the following is the minimum code required to create a MTEXT entity with entmake: (entmake '( These entries must follow group code 0 and must precede group codes that are specifically used to define entity properties in the entmake list. In addition, one or more subclass marker entries are required to identify the specific sub-entity type. All AutoCAD entities have the AcDbEntity subclass marker, and this must be explicitly included in the entmake list. entmake cannot create viewport entities.įor entity types introduced in AutoCAD Release 13 and later releases, you must also specify subclass markers (DXF group code 100) when creating the entity.The elist argument must contain all of the information necessary to define the entity. Arguments elist A list of entity definition data in a format similar to that returned by the entget function. Any internal fields passed to entmake are ignored. entmake (AutoLISP) Creates a new entity in the drawing (entmake elist ) The entmake function can define both graphical and nongraphical entities.There is one exception: entmake accepts new layer names. ![]() AutoCAD must recognize all objects that the entity list refers to.If the first member does not specify the type, it can specify only the name of the entity: group -1 (the name is not saved in the database). The first or second member in the list must specify the entity type.The following entmake restrictions apply to all entities: The following example code creates a circle on the MYLAYER layer: (entmake '((0. If the entity is a complex entity (an old-style polyline or a block), it is not appended to the database until it is complete. The new entity that the list describes is appended to the drawing database (it becomes the last entity in the drawing). Like that of entmod, the argument to entmake is a list whose format is similar to that returned by entget. ![]() An application can add an entity to the drawing database by calling the entmake function. ![]()
0 Comments
Leave a Reply. |