tama010 Posted January 8, 2015 Share Posted January 8, 2015 Hello, I am currently trying to store any dimensional text to a string value I have started to use entsel to select single dimension to store the entity How should i approach to store the dimensional text from the entity information as a string value? This is an example what I want to store the string as: "%%C " Any help will be appreciated. Thank you Quote Link to comment Share on other sites More sharing options...
BlackBox Posted January 8, 2015 Share Posted January 8, 2015 Welcome to CADTutor. Consider the TextOverride Property; quick example: (vl-load-com) (defun c:FOO (/ ss oDim s) (if (setq ss (ssget ":S:E" '((0 . "DIM*")))) (progn (setq oDim (vlax-ename->vla-object (ssname ss 0))) (prompt (strcat "\nTextOverride: " (if (and (vlax-property-available-p oDim 'textoverride) (/= "" (setq s (vla-get-textoverride oDim))) ) s "<Empty String> " ) ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
tama010 Posted January 8, 2015 Author Share Posted January 8, 2015 Thank you for your help Blackbox, the textoverride property works perfect! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 9, 2015 Share Posted January 9, 2015 (edited) Removed answer posted to wrong post Edited January 9, 2015 by BIGAL Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 9, 2015 Share Posted January 9, 2015 As an alternative to ActiveX(COM) and for compatibility on a Mac, you could also use DXF group 1, e.g.: (defun c:test ( / e i s ) (if (setq s (ssget "_:L" '((0 . "*DIMENSION") (1 . "~%%C <>")))) (repeat (setq i (sslength s)) (setq e (entget (ssname s (setq i (1- i))))) (entmod (subst '(1 . "%%C <>") (assoc 1 e) e)) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
BlackBox Posted January 9, 2015 Share Posted January 9, 2015 Thank you for your help Blackbox, the textoverride property works perfect! You're very welcome, tama010; I'm happy to help. Cheers 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.