DWG Destroyer Posted November 3, 2009 Posted November 3, 2009 I've been doing a bit of match properties for text elements in drawings recently, and have found that the matchprop button is a real drag when attempting to synchronize text styles throughout a drawing. When matchprop is used to match multiple texts, they will all fling off in the direction the selected text is set at. I want to make it so that I can use match properties without matching the rotation. I’ve tried toggling the settings to no avail - I want everything else to be the same except geometry. Hope someone can help!! Quote
alanjt Posted November 3, 2009 Posted November 3, 2009 I've been doing a bit of match properties for text elements in drawings recently, and have found that the matchprop button is a real drag when attempting to synchronize text styles throughout a drawing. When matchprop is used to match multiple texts, they will all fling off in the direction the selected text is set at. I want to make it so that I can use match properties without matching the rotation. I’ve tried toggling the settings to no avail - I want everything else to be the same except geometry. Hope someone can help!! Wow, I never use Match Properties, but I always assumed you could turn the rotation setting off. Sounds like you'll have to roll your own. What properties are you wanting to match? Quote
DWG Destroyer Posted November 3, 2009 Author Posted November 3, 2009 NEVER USE MATCH PROPERTIES?! I am shocked. I dread to think where I would be without it. Explaining everything I want it to do would most likely be very long winded when I can just say I need it to function exactly as the normal matchprop - aside from mimicking rotation. And you are right in saying that the settings can be adjusted, but when I do that it will not only ignore rotation but also ignore the text style/ size etc. which is definitely no good for me! I intend to use it in conjunction with Lee Mac's "MacAlign" command, which creates a piece of text in perfect alignment with a selected object. After doing this it would be great to be able to quickly match the style of the newly created text to that of existing text. Quote
alanjt Posted November 3, 2009 Posted November 3, 2009 NEVER USE MATCH PROPERTIES?! I am shocked. I dread to think where I would be without it. Explaining everything I want it to do would most likely be very long winded when I can just say I need it to function exactly as the normal matchprop - aside from mimicking rotation. And you are right in saying that the settings can be adjusted, but when I do that it will not only ignore rotation but also ignore the text style/ size etc. which is definitely no good for me! I intend to use it in conjunction with Lee Mac's "MacAlign" command, which creates a piece of text in perfect alignment with a selected object. After doing this it would be great to be able to quickly match the style of the newly created text to that of existing text. True, but with text, the important matches LAYER, COLOR, STYLE, SIZE, ROTATION. Generally I only want to match the layer, so all the add ons that come with Match Properties are unnecessary. I wrote my own LayerPut. Command: LP Select object(s) to be changed: Select objects: Specify opposite corner: 1 found Select objects: Select object on destination layer or [Current/Dialog/Type]: 1 object(s) moved to layer "CNTR", the current layer. Quote
DWG Destroyer Posted November 3, 2009 Author Posted November 3, 2009 I can definitely see it's use, though sadly for me the matching of styles/ sizes etc are of sterling importance Quote
alanjt Posted November 3, 2009 Posted November 3, 2009 Try this, completely untested: [color=Yellow];;; Match Text/Mtext Style and Height of source Text/Mtext object ;;; Alan J. Thompson, 11.03.09 (defun c:MS (/ *error* #Obj #SS #Style #Size) ;;; error handler (defun *error* (#Message) (and *AcadDoc* (vla-endundomark *AcadDoc*)) (and #Message (not (wcmatch (strcase #Message) "*BREAK*,*CANCEL*,*QUIT*")) (princ (strcat "\nError: " #Message)) ) ;_ and ) ;_ defun (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) (vla-startundomark *AcadDoc*) (cond ((and (setq #Obj (car (entsel "\nSelect source text object: "))) (vl-position (cdr (assoc 0 (entget #Obj))) '("MTEXT" "TEXT")) (setq #Obj (vlax-ename->vla-object #Obj)) ;; (setq #Obj (AT:Entsel nil "\nSelect source text object: " '("V" (0 . "MTEXT,TEXT")) nil)) (setq #SS (ssget "_:L" '((0 . "MTEXT,TEXT")))) ) ;_ and (setq #Style (vla-get-stylename #Obj) #Size (vla-get-height #Obj) ) ;_ setq (vlax-for x (setq #SS (vla-get-activeselectionset *AcadDoc*)) (vl-catch-all-apply 'vla-put-stylename (list x #Style)) (vl-catch-all-apply 'vla-put-height (list x #Size)) ) ;_ vlax-for (vl-catch-all-apply 'vla-delete (list #SS)) ) ) ;_ cond (*error* nil) (princ) ) ;_ defun[/color] Updated and more robust version here: http://www.cadtutor.net/forum/showthread.php?t=41669 Quote
DWG Destroyer Posted November 3, 2009 Author Posted November 3, 2009 Looks promising! Though something is causing the routine to error; Command: MS Select source text object: Select objects: 1 found Select objects: ; error: ActiveX Server returned the error: unknown name: TextStyle Command: Command: MS Select source text object: Select objects: 1 found Select objects: ; error: ActiveX Server returned the error: unknown name: TextStyle Command: Text style? I am using RomanS, though any other style i try delivers the same result... Quote
JohnM Posted November 3, 2009 Posted November 3, 2009 I’m all for writing custom programs when necessary but in this case, wouldn’t it be just as easy to use the AutoCAD’s properties dialog with quick select? Quote
alanjt Posted November 3, 2009 Posted November 3, 2009 Looks promising! Though something is causing the routine to error; Command: MS Select source text object: Select objects: 1 found Select objects: ; error: ActiveX Server returned the error: unknown name: TextStyle Command: Command: MS Select source text object: Select objects: 1 found Select objects: ; error: ActiveX Server returned the error: unknown name: TextStyle Command: Text style? I am using RomanS, though any other style i try delivers the same result... Oops, fixed above. Quote
DWG Destroyer Posted November 3, 2009 Author Posted November 3, 2009 I’m all for writing custom programs when necessary but in this case, wouldn’t it be just as easy to use the AutoCAD’s properties dialog with quick select? A valid argument, though marginally slower than the method i am hoping for. Especially if i am to be using it multiple times for single pieces of text here and there throughout the day! I know through the eyes of some it might look a little petty, but i do like making things happen with a single click Quote
DWG Destroyer Posted November 3, 2009 Author Posted November 3, 2009 Oops, fixed above. Taken a step forward, though now i am getting the same error message but it mentions text height and not text style as before! Quote
alanjt Posted November 3, 2009 Posted November 3, 2009 Taken a step forward, though now i am getting the same error message but it mentions text height and not text style as before! I'm such a 'tard, check it now. Quote
DWG Destroyer Posted November 3, 2009 Author Posted November 3, 2009 Trial and error i guess Well the command runs through ok, but does not affect the selected texts! I select the source text object and then the other text objects to conform to the source text, hit enter and AutoCAD seems satisfied and ready for a new command, though nothing has changed! Most stubborn :@:@ Quote
alanjt Posted November 3, 2009 Posted November 3, 2009 Trial and error i guess Well the command runs through ok, but does not affect the selected texts! I select the source text object and then the other text objects to conform to the source text, hit enter and AutoCAD seems satisfied and ready for a new command, though nothing has changed! Most stubborn :@:@ My head just isn't screwed on today. I should have evaluated what I was actually typing. Updated in original post. Quote
DWG Destroyer Posted November 4, 2009 Author Posted November 4, 2009 Not to worry. Have tested it again and it seems to work great! Although I did notice it doesn’t place the modified text onto the layer the source text is on? Quote
alanjt Posted November 4, 2009 Posted November 4, 2009 Not to worry. Have tested it again and it seems to work great! Although I did notice it doesn’t place the modified text onto the layer the source text is on? I didn't intend for it to. If I have time, I'll add it. It's only a couple lines of code, give it a shot. Quote
stevesfr Posted November 4, 2009 Posted November 4, 2009 Oops, fixed above. can you make it change the text width factor to match the initial pick? Quote
DWG Destroyer Posted November 4, 2009 Author Posted November 4, 2009 I didn't intend for it to. If I have time, I'll add it. It's only a couple lines of code, give it a shot. I wish i could, but script writing is lost on me Though i did manage to cobble together a work around, just a macro that invokes this command and then layer match after. A little messy but nevertheless! Quote
alanjt Posted November 4, 2009 Posted November 4, 2009 I wish i could, but script writing is lost on me Though i did manage to cobble together a work around, just a macro that invokes this command and then layer match after. A little messy but nevertheless! All it takes is a little reading and practice. BTW, it's not a script. I'll have something new up in just a minute. Quote
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.