richard3009 Posted October 11, 2010 Share Posted October 11, 2010 I have 200 drgs with the drawing numbers justified incorrectly what sort of lisp routine could i target them with, all the first 8 digits of the drg numbers are the same on each one so a wild card targeting should work. Quote Link to comment Share on other sites More sharing options...
pBe Posted October 11, 2010 Share Posted October 11, 2010 attributes or table text? Quote Link to comment Share on other sites More sharing options...
richard3009 Posted October 11, 2010 Author Share Posted October 11, 2010 Its single line text not even mtext, not attributes Im affraid Quote Link to comment Share on other sites More sharing options...
pBe Posted October 11, 2010 Share Posted October 11, 2010 refer to this thread for text justification (soulution by Lee Mac) http://www.cadtutor.net/forum/showthread.php?29254-Text-Justification-Routine-Help&highlight=text+justification The routine is easy.. the real problem is running in through 200 drawings, just remember to change the DXF 72 code to suite your needs. heres a guide: ;DXF 72 ; Horizontal text justification type (optional, default = 0) integer codes (not bit-coded) ; ;0 = Left; 1= Center; 2 = Right ; ;3 = Aligned (if vertical alignment = 0); ; ;4 = Middle (if vertical alignment = 0); ; ;5 = Fit (if vertical alignment = 0); ; ;See the Group 72 and 73 integer codes table for clarification Now you can either use a script or used ObjectDBX (which i'm still trying to learn ) still you need a routine for string matching... (wcmatch "your string" "pattern*") Quote Link to comment Share on other sites More sharing options...
pBe Posted October 11, 2010 Share Posted October 11, 2010 chagne the line 11 to something like this.. (IF (AND (= enttyp "TEXT") (wcmatch (cdr (assoc 1 ent1)) "YOUR 8 DIGIT*") ) ) (progn ..... and oh.. dont forget to change dxf 72 to suit you neeeds Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 11, 2010 Share Posted October 11, 2010 Wow - that is old code, I'm embarassed to see that dragged up again lol Here is a quick code, slapped together: (defun c:tJust ( / 72code 73code ss ) ;; © Lee Mac 2010 (setq 72code 1 73code 2) (if (setq ss (ssget "_X" '((0 . "TEXT") (1 . "12345678*")))) ( (lambda ( i / x l ) (while (setq x (ssname ss (setq i (1+ i)))) (setq l (entget x)) (entupd (cdr (assoc -1 (entmod (subst (cons 72 72code) (assoc 72 l) (subst (cons 73 73code) (assoc 73 l) (subst (cons 11 (cdr (assoc 10 l))) (assoc 11 l) l ) ) ) ) ) ) ) ) ) -1 ) ) (princ) ) Change the 72/73 code and filter as necessary. Quote Link to comment Share on other sites More sharing options...
pBe Posted October 11, 2010 Share Posted October 11, 2010 Man!!! 2008!! Now I’m embarrassed.. apologies Lee Mac You’ve come a long way since then.. Think of it this way, you wouldn’t have gotten as good as you are if you hadn’t gone through all that Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 11, 2010 Share Posted October 11, 2010 No worries mate, I was just joking with you But yeah, we all have to start somewhere 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.