Lt Dan's legs Posted August 11, 2011 Share Posted August 11, 2011 is it faster to entmake something and then vlax-ename->vla-object or vla-add(object)? Example: (vlax-ename->vla-object (entmakex (list (cons 0 "line") (cons 10 (list 0. 0. 0.)) (cons 11 (list 10. 10. 0.)) ) ) ) or (vla-addline (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object) ) ) (vlax-3d-point (list 0. 0. 0.)) (vlax-3d-point (list 10. 10. 0.)) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 11, 2011 Share Posted August 11, 2011 The ent* functions are quicker for modification to the drawing database, the difference will be made more significant if you are repeatedly retrieving the application, document and modelspace objects. Quote Link to comment Share on other sites More sharing options...
Lt Dan's legs Posted August 11, 2011 Author Share Posted August 11, 2011 I entmake lines, polylines, mtext and leaders a lot. I really have it setup like (defun polyline ( pointslst layer flag / e ) (and pointslst (laycheck layer) (setq e (entmakex (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 (length pointslst)) (cons 70 1) (cons 8 layer) (cons 43 0.0) ) (mapcar (function (lambda ( x ) (if (listp x)(cons 10 x) (cons 42 x) ) ) ) pointslst ) ) ) ) ) (if (and e flag) (vlax-ename->vla-object e) e ) ) and Thanks for the (setq *acdoc* (cond ( *acdoc* ) ( (vla-get-activedocument (vlax-get-acad-object)) ) ) ) I use this whenever I can Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 11, 2011 Share Posted August 11, 2011 It's also nicer when using ent* because you can create the object with the properties you want, rather than put'ing them after the object has been created. Of course, if the object is annotative (*text, blocks, mleaders, dimensions) I recommend vla all day. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.