wimal Posted May 24, 2018 Share Posted May 24, 2018 Can we find out the length of texts by lisp. Quote Link to comment Share on other sites More sharing options...
dlanorh Posted May 24, 2018 Share Posted May 24, 2018 Yes, you can using the Bounding Box Method. It will give you the lower left and upper right coords then you need to calc length and height. Easy if it is at rotation 0 90 180 or 270, slightly more difficult for any other rotation. Quote Link to comment Share on other sites More sharing options...
wimal Posted May 24, 2018 Author Share Posted May 24, 2018 Yes, you can using the Bounding Box Method. It will give you the lower left and upper right coords then you need to calc length and height. Easy if it is at rotation 0 90 180 or 270, slightly more difficult for any other rotation. I have no idea with Bounding Box method. Pl. explane Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 24, 2018 Share Posted May 24, 2018 Try this (setq util (vla-get-utility (vla-get-activedocument (vlax-get-acad-object)))) (vla-getentity util 'obj 'ip "\nSelect Object: ") (vla-GetBoundingBox obj 'minpoint 'maxpoint) (setq pointmin (vlax-safearray->list minpoint)) (setq pointmax (vlax-safearray->list maxpoint)) (princ pointmin)(princ "\n")(princ pointmax) Quote Link to comment Share on other sites More sharing options...
wimal Posted May 24, 2018 Author Share Posted May 24, 2018 Try this (setq util (vla-get-utility (vla-get-activedocument (vlax-get-acad-object)))) (vla-getentity util 'obj 'ip "\nSelect Object: ") (vla-GetBoundingBox obj 'minpoint 'maxpoint) (setq pointmin (vlax-safearray->list minpoint)) (setq pointmax (vlax-safearray->list maxpoint)) (princ pointmin)(princ "\n")(princ pointmax) Thanks for the quick reply. Quote Link to comment Share on other sites More sharing options...
dlanorh Posted May 24, 2018 Share Posted May 24, 2018 Another (vl-load-com) (defun c:tw (/ c_doc obj minExt maxExt dist d_ang width ht) (setq c_doc (vla-get-ActiveDocument (vlax-get-acad-object)) obj (vlax-ename->vla-object (car (entsel "\nSelect entity to be object data : "))) ) (vla-GetBoundingBox obj 'minExt 'maxExt) (setq dist (distance (vlax-safearray->list minExt) (vlax-safearray->list maxExt)) d_ang (angle (vlax-safearray->list minExt) (vlax-safearray->list maxExt)) width (* (cos d_ang) dist) ht (* (sin d_ang) dist) ) (princ (strcat "\nWidth = " (rtos width 2) " : Height = " (rtos ht 2))) );_end_GBB defun (princ) Quote Link to comment Share on other sites More sharing options...
wimal Posted May 24, 2018 Author Share Posted May 24, 2018 (setq text_list (ssget"C"pt1 pt2 '((0 . "TEXT") ))); list of texts When the texts are inside the selection set . How can I modify above codes. Quote Link to comment Share on other sites More sharing options...
dlanorh Posted May 24, 2018 Share Posted May 24, 2018 (setq text_list (ssget"C"pt1 pt2 '((0 . "TEXT") ))); list of texts When the texts are inside the selection set . How can I modify above codes. Was this to me or BIGAL? If me, what are you trying to do with the text entities? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 24, 2018 Share Posted May 24, 2018 I would suggest using the textbox function - here is an example. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 25, 2018 Share Posted May 25, 2018 Also for future to reduce confusion, a ssget makes a "Selection set" a "List" is a variable containing a number of values in simple terms. Quote Link to comment Share on other sites More sharing options...
wimal Posted May 25, 2018 Author Share Posted May 25, 2018 Thanks all for your valuable instructions. 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.