CADTutor: The best free help for AutoCAD on the web

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Go Back   AutoCAD Forums > AutoCAD > AutoLISP, VBA, the CUI & Customisation

Reply
 
Thread Tools
Old 3rd Nov 2009, 12:03 pm   #1
DWG Destroyer
Full Member
 
Using: AutoCAD 2009
 
Join Date: Jul 2009
Posts: 74
Question Match properties EXCLUDING rotation

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!!
DWG Destroyer is offline   Reply With Quote
Old 3rd Nov 2009, 02:46 pm   #2
alanjt
Super Member
 
alanjt's Avatar
 
Using: Civil 3D 2009
 
Join Date: Apr 2008
Posts: 1,488
Default

Quote:
Originally Posted by DWG Destroyer View Post
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?

Seann: ...it went crazy ex-girlfriend on me...
eric_monceaux...
its pretty funny seeing two AutoCAD Gods give each other flak...
alanjt is offline   Reply With Quote
Old 3rd Nov 2009, 03:31 pm   #3
DWG Destroyer
Full Member
 
Using: AutoCAD 2009
 
Join Date: Jul 2009
Posts: 74
Default

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.
DWG Destroyer is offline   Reply With Quote
Old 3rd Nov 2009, 03:41 pm   #4
alanjt
Super Member
 
alanjt's Avatar
 
Using: Civil 3D 2009
 
Join Date: Apr 2008
Posts: 1,488
Default

Quote:
Originally Posted by DWG Destroyer View Post
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.

Code:
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.
TEXT.jpg

Seann: ...it went crazy ex-girlfriend on me...
eric_monceaux...
its pretty funny seeing two AutoCAD Gods give each other flak...
alanjt is offline   Reply With Quote
Old 3rd Nov 2009, 03:53 pm   #5
DWG Destroyer
Full Member
 
Using: AutoCAD 2009
 
Join Date: Jul 2009
Posts: 74
Default

I can definitely see it's use, though sadly for me the matching of styles/ sizes etc are of sterling importance
DWG Destroyer is offline   Reply With Quote
Old 3rd Nov 2009, 04:22 pm   #6
alanjt
Super Member
 
alanjt's Avatar
 
Using: Civil 3D 2009
 
Join Date: Apr 2008
Posts: 1,488
Default

Try this, completely untested:

Code:
;;; 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
Updated and more robust version here: http://www.cadtutor.net/forum/showthread.php?t=41669

Last edited by alanjt : 4th Nov 2009 at 05:51 pm. Reason: I'm retarded.

Seann: ...it went crazy ex-girlfriend on me...
eric_monceaux...
its pretty funny seeing two AutoCAD Gods give each other flak...
alanjt is offline   Reply With Quote
Old 3rd Nov 2009, 04:43 pm   #7
DWG Destroyer
Full Member
 
Using: AutoCAD 2009
 
Join Date: Jul 2009
Posts: 74
Default

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...
DWG Destroyer is offline   Reply With Quote
Old 3rd Nov 2009, 04:58 pm   #8
JohnM
Senior Member
 
Using: AutoCAD 2006
 
Computer Details
 
Join Date: Feb 2009
Location: houston, texas
Posts: 163
Default

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?
JohnM is offline   Reply With Quote
Old 3rd Nov 2009, 05:03 pm   #9
alanjt
Super Member
 
alanjt's Avatar
 
Using: Civil 3D 2009
 
Join Date: Apr 2008
Posts: 1,488
Default

Quote:
Originally Posted by DWG Destroyer View Post
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.

Seann: ...it went crazy ex-girlfriend on me...
eric_monceaux...
its pretty funny seeing two AutoCAD Gods give each other flak...
alanjt is offline   Reply With Quote
Old 3rd Nov 2009, 05:12 pm   #10
DWG Destroyer
Full Member
 
Using: AutoCAD 2009
 
Join Date: Jul 2009
Posts: 74
Default

Quote:
Originally Posted by JohnM View Post
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
DWG Destroyer is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Match Attribute Rotation VisDak AutoLISP, VBA, the CUI & Customisation 2 5th Jul 2009 11:06 am
match properties FIFTHTEXAS AutoCAD General 2 17th Mar 2009 01:17 am
match properties yawdapaah AutoCAD Beginners' Area 7 5th Mar 2009 05:36 pm
Match properties for blocks stevedallas AutoLISP, VBA, the CUI & Customisation 7 28th Apr 2008 06:28 pm
match properties eddie57 AutoCAD Beginners' Area 1 3rd Dec 2005 06:59 pm

Why Donate?


All times are GMT +1. The time now is 04:17 am.

RSS Feed for AutoCAD ForumsValid XHTML 1.0!Valid CSS!Creative Commons Licence