AutoCAD Visual LISP / AutoLISP :: How To Mirror MTEXT Existing In Drawing

Aug 2, 2012

i have a situation that i need to mirror a lot of MTEXT exisiting in my drawing with following needs ( as attached CAD file) :

- MIRRTEXT = 1

- original text retain not deleted.

- mirrored texts become on another layer with another color.

- mirrored texts exactly become over the original text.

View 1 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Combine Multiple Mtext Into 1 Mtext

Apr 16, 2009

Tool to combine multiple pieces of Mtext into a single Mtext with paragraphs?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Mirror Object Automatically

Nov 10, 2011

I am looking for a lisp routine which will allow me to mirror an object that I pick automatically.  I don't want to have to pick the two points to set the mirror line.  I just want the point I pick on of the object I select to be the point of the mirror.  If that can't happen, I was wondering if the object could mirror at its insertion point (like if it were a block or a text.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Mtext Editing

Nov 12, 2013

I have mtext in several drawings that contains an error that'd I'd like to fix using Lisp.  An example of what this text should look like is:

NOTE:

SEE DRAWING XXXX FOR DRIVE DETAILS

The fist problem is that all of the text after the note has a width factor of 0.1 and is all squished together.  The second problem is that the text height of the title (the "NOTE:" part) is supposed to be larger than the actual note (the "SEE DRAWING XXXX FOR DRIVE DETAILS" PART).  Is there a way to fix this using lisp?  I had a lisp in progress (not done) which is:

(IF
  (SETQ SSET (SSGET "X" '((0 . "MTEXT"))))
  (PROGN
    (SETQ COUNT -1)
    (WHILE (< (SETQ COUNT (1+ COUNT)) (SSLENGTH SS))
      (SETQ ENTDATA (ENTGET (SSNAME SSET COUNT)))
      (SETQ ENTTEXT (CDR (ASSOC 1 ENTDATA)))
      (ENTMOD (SUBST (CONS 1 (STRCAT "{\W1;" ENTTEXT "}")) (ASSOC 1 ENTDATA) ENTDATA))

The last line has no effect on the width factor of the note.

This is the entdata for this particular piece of mtext (they aren't all the same):

((-1 . <Entity name: 7ffff79ce50>) (0 . "MTEXT") (330 . <Entity name:
7ffffb069f0>) (5 . "392FD") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"5") (100 . "AcDbMText") (10 676.276 751.03 0.0) (40 . 3.008) (41 . 0.0) (46 .

[Code]....

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Mtext Background

Aug 31, 2011

I have a routine, developed for me through this forum, that selects text or mtext, converts to mtext if not already, and puts a background mask with 1.1 border. I was using it fine in Map 3D 2007, but have recently switched to Civil 3D 2012 where it does not work. I get this error message:

; error: no function definition: VLAX-ENAME->VLA-OBJECT

Why does this not work in 2012? How to get it to work?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Text String From Mtext?

Aug 20, 2013

I'm looking for a function to return the actual text from an mtext object.if there's a carraige return I wish to replace it with a space.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: MText - Set Limits Box To Minimum?

Jan 11, 2006

I would like to write a routine to resize the MText limits box to the minimum size required to cover the text, for background masking purposes. From the DXF codes, I see that I can simply set code 41 to match code 42 in order to set the width. However, I cannot seem to figure out how the vertical dimension is defined. (entget) shows no change in the DXF codes after I resize the mtext box.

I do know how to figure out the height that I need, using (acet-geom-textbox), but I can't seem to figure out how to apply this height the MText entity.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Converting MText To Multileader

Nov 19, 2013

I got this nice little lisp from [URL] .....
 
(defun c:mt2ml ( / oobj nobj nstrg) (vl-load-com) (setq oobj (vlax-ename->vla-object (car (nentsel "
Select source text: ")))) (if (= (vlax-get-property oobj 'ObjectName) "AcDbMText") (setq nstrg (vlax-get-property oobj 'TextString)) (exit) ) (command "_MLEADER") (while (= 1 (logand (getvar "CMDACTIVE") 1)) (command PAUSE)) (setq nobj (vlax-ename->vla-object (entlast))) (if (= (vlax-get-property nobj 'ObjectName) "AcDbMLeader") (vlax-put-property nobj 'TextString nstrg) (exit) ) (entdel (vlax-vla-object->ename oobj)) (princ))

It converts MText to a Multileader.

My goals would be as follows:
 
The multileader should end up on the same layer as the Mtext.  (Currently it uses the current layer.)The multileader should hold the same rotation as the Mtext. (Currently it goes to zero.)The multileader should be created in the same location as the Mtext, without the user having to click.  (Currently the multileader is created wherever the user clicks.)The multileader should be created without a leader.  We can add one afterwards if needed, but for many we don't need a leader.  (We're just using the object as mtext with a box around it.)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Calling Mleaders With Mtext

Oct 17, 2007

I'm finding Mleaders with Mtext don't seem to play well with command calls. All works fine until one tries to enter the mleader text. Before testing this, be sure your mleader style is set to use mtext. I recommend starting the leader with the arrow first.

Compare this mleader's text entry behavior in this basic lisp command call:(command "_.acad_dim.mleader") with the following routine that relies on an open ended command prompt (useful if you want to add more commands after calling the mleader command):

(defun c:mlx (/ cc_echo)
(prompt "
Example showing mleader mtext misbehaving")
(setq cc_echo (getvar "cmdecho"))
(setvar "cmdecho" 1)
(command "_.acad_dim.mleader")
[code]...

With qleaders, the leader and text are separate entities.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Edit MTEXT Attribute Value

Dec 13, 2013

I'm having issues with updating an MTEXT attributes value using lisp.

If I insert my block (this is a titleblock) and run my lisp routine the MTEXT attribute updates fine.  Once I edit the MTEXT attribute with the MTEXT editor, and then run my lisp routine again, the MTEXT attribute will not update anymore.  All the single line (DTEXT) attributes update fine.  The lisp routine I created has worked for years...this is the first time I've tried it with an MTEXT attribute.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Mtext Rotate To Line

Oct 15, 2013

Lisp routine that will rotate Mtext to the same angle as the angle of a selected line and the allow you to place the mtext object where you wish.

I know there is an lisp out there called RTL that will allow you to do this with regular or Dtext, but I will not work with Mtext.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remove Space From MTEXT

Apr 25, 2013

In my drawing I have lot of MTEXTS having unwanted spaces in between the text strings. 

A lisp to remove space from MTEXT. Here i am attaching sample drawing with MTEXT which is to be modify. Magenta color MTEXT need to modify like yellow color MTEXT.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Prompt Text / Mtext Not Selected

Nov 13, 2012

I’m trying to put together a loop for if nil or something other than text or mtext is accidentally selected than prompt text was not selected. This is what I have so far.

text or mtext is not selected than prompt

(defun C:ww ()
(while
(not
(and
(setq esel (entsel "
[Code]......

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Access Text In MTEXT Entity

Dec 29, 2012

I am wanting to use autolisp to access the text in a MTEXT entity.  assoc(1) gives me the first bit of text, but not the rest.Is there a way to use assoc to access each of a number of matches or do I need to write my own routine to find all the 1's?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Mtext With Two Different Sizes Of Words

Nov 25, 2013

I looking into a way to insert mtext with two differents sizes of the words just like the image about in autolisp.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Circles And MText Within Specified Points?

Apr 9, 2012

I am not sure why this is not working.

(setq SelectionSet (ssget "C" Point1 Point2 '((-4 . "<or") (0 . "CIRCLE") (0 . "MTEXT") (-4 . "<or"))))

I want to select circles and mtext within the specified points.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Accept Text Height In Mtext Command

May 31, 2013

I am working on a simple function to add/remove a non-printing stamp our drawings to specify a preliminary drawing. The issue is that I cannot seem to get AutoCAD to accept the text height in the Mtext command. Below is the code; try it and see.

(DEFUN NOT4CONSTRUCTION(/ CTR HGT PT1 PT2) (IF (EQ (GETVAR "CLAYER") "NOT4CONSTRUCTION") (SETVAR "CLAYER" "0")) (IF (EQ (GETVAR "CTAB") "MODEL") (SETQ HGT "8'-4"") (SETQ HGT "1"")) (IF (= (ASSOC 0 (TBLSEARCH "layer" "NOT4CONSTRUCTION")) nil) (PROGN (VL-CMDF "-LAYER" "M" "NOT4CONSTRUCTION" "C" "30" "" "TR" 90 "" "P" "N" "" "") (SETQ PT1(LIST (- (CAR (GETVAR "viewctr")) (/ (* (GETVAR "viewsize") (/ (CAR (GETVAR.
[code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Explode Mtext - Get X Y Coordinates Of Last Line Of Text

Mar 19, 2012

Would like to be able to select mtext explode it get x y coords of last line of text then turn it back to mtext and then launch mtext at a @0,-0.5  justification TL width 5 and display the ribbon.

All seems to work except the (command ...)

Below is my attempt.

(prompt "Select Note")
(setq ss (ssget))
(command "explode" ss)
(setq ss (ssget "l")) ;get last line of text

(setq ent (entget (ssname ss 0))
ent1 (cdr (assoc 10 ent))) ;get x y coords
(command "undo" "1") ;set exploded mtext back to mtext
(setvar "lastpoint" ent1)

(command "mtext" "@0,-0.4" "j" "TL" "w" "5")

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find And Replace Pre-defined Text / MText Value

Feb 10, 2011

Is there a lisp or script program that will find and replace pre-defined text/mtext value of eg " issued for tender " for "issued for construction" without having to select anything.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Closed Polyline And Place Mtext With The Room Name And Area In M2

Oct 24, 2013

LSP file i downlaoded from web.it is to use for Area with (m2) and room name. by click polyline.

i want to modify it to use without adding Room Name, just insert area to the drawing.

(defun drtxt (/ rn tx ls vl lt ht lb hb nr pt)
  (setq tx (strcat "Area: "
       (rtos (/ (getvar "area") 1000000) 2 2)
       " m2"
       )         
       rn (getstring "
Room Name: ")

[code]....

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Entmake Mtext Start And Stop Underline And Styles

Jun 4, 2013

I am trying to create an mtext entity using entmake with different text height, text style and underlining. I have a subroutine that works fine. However - I would like to use different text height, text style and underline for the Title Text vs the following lines.

Here is the subroutine I already have -

(defun Create_MText (MT_PMS MT_Layout MT_Layer MT_Style MT_Justify MT_Point MT_Rotate MT_Size MT_Width MT_Title MT_Body / )
(setq FSC_MText
(list
(cons 0 "MTEXT")

[Code] .......

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Layer From Highlighting Words In Text Or Mtext?

Sep 23, 2011

I want to create a layer from selecting only some words from an mtext or text entitty.

Is it possible to highlight and select only part of the text from an mtext using a lisp routine ? similar to how Adobe Reader can select text.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Use Existing Arc As Fillet Rad

Mar 21, 2007

I have this routine for using a selected arcs rad value as a new fillet rad. If you like, a "match fillet" routine:

;Fillet Copy
;Copies the Radius of an Existing Fillet or Arc;
(defun C:filletcopy ()
(setvar "cmdecho" 0)
(setq c1 (entsel "
Select Fillet to Copy:"))
(setq c1 (entget (car c1)))
(setq rad (cdr(assoc 40 c1)))
(setvar "filletrad" rad)
(princ "
Select Lines:")
(command ".fillet" pause pause)
)

I use the routine loads but could modify so it would pick up the value of a filleted polyline? As it stands it can only select an individual arc. I would like the routine to be able to pick individual arcs and/or filleted polylines, without exploding first, if possible....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Suppress Mtext Command Current Text Style / Prompt

Nov 3, 2011

I'm running the following string in a routing that is looping so I get dozens of these prompts. How to supress these?  Or, do i have to use to entmake?

(begin loop...
(command ".-Mtext" CSW-Tpoint "W" 0.0 (vl-filename-base (vla-get-imagefile image)) "")
);end loop

Prints to the command line..

Current text style:  "Standard"  Text height:  0.0833  Annotative:  No
Current text style:  "Standard"  Text height:  0.0833  Annotative:  No
Current text style:  "Standard"  Text height:  0.0833  Annotative:  No
Current text style:  "Standard"  Text height:  0.0833  Annotative:  No

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Redefine Existing Block

Jan 29, 2012

I am using the following function to create a block:

(defun crea-blocco (ip blockname gruppoogg / blkobj sArray c r vla-objects doc) (setq c -1) (repeat (sslength gruppoogg) (setq r (cons (ssname gruppoogg (setq c (1+ c))) r)) ) (setq r (reverse r)) (setq vla-objects (mapcar 'vlax-ename->vla-object r)) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (setq blkobj (vla-add (vla-get-blocks doc) (vlax-3d-point ip) blockname)) (setq sArray (vlax-safearray-fill (vlax-make-safearray vlax-vbObject (cons 0 (1- (length vla-objects)))) vla-objects)) (vla-copyobjects doc sArray blkobj) blkobj)
 
But if I start this function two times with the same block name, I get a block with the selected objects added to the existing block.

How can I redefine an existing block with vlisp?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Override Existing Commands

Mar 19, 2012

Any way to override existing AutoCAD commands.

Lets try this.  When a user types "line" at the command prompt, or hits the "line" button on the toolbar, or chooses "line" from the draw pulldown menu, is there any way I can re-write what line means and draw a circle?  (Extreme example)

There are just some commands that I'd like to have a variable set in the background, depending on what the command is.  So I'm thinking if I could re-write the "line" command, instead of trying to convince everyone to use and remember a custom command, it would be much more efficient.  There are lisp files already loaded in their start-up suite.  Not sure if that works.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Existing Selection Set?

Sep 5, 2012

I need the same funcionality as in code below, but without using "command".

The main idea is alowed user to modify Existing Selection Set.

 (defun gt:ss->lst (a:ss / i lst ) ;_ / (setq i 0) (if a:ss (progn (repeat (sslength a:ss) (setq lst (cons (ssname a:ss i) lst) i (1+ i) ) ;_ setq ) ;_ repeat (reverse lst) ) ;_ progn ) ;_ if) ;_ defun gt:ss->lst(defun gt:ss_modify (a:en-lst / ) ;_ / ;;create Selection set (setq ss2 (ssadd)) (foreach f:en a:en-lst (ssadd f:en ss2) ) ;_ foreach ;;Run command and fill with initial content (command "_select" ss2) ;;Alow the user to modify the contents (while (/= (getvar "cmdnames") "") (command pause) ) ;_ while ;;get back the list of enames from modified selection set (setq ss3 (ssget "_P")) (setq ss3-lst (gt:ss->lst ss3))) ;_ defun gt:ss_modify(defun tst:gt:ss_modify ( / ) ;_ / (gt:ss_modify (gt:ss->lst (ssget)))) ;_ defum tst:gt:ss_modify

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Mtext String In Group 1 Does Not Match Text Shown Or In Property Window

May 17, 2012

I have a routine that looks for an MText date stamp and replace the old date with a new date.  The problem is some MText strings appear encrypted.  Below is an example:

{\H1.121x;\C1; \LFY 2011-12\l \H0.6252x;04-30-11} This is what I should get when I extract the string (as shown in Property window)

(1 . "\pxi-2.1818,l4.3636,ql,t4.3636;{\fSymbol|b1|i0|c2") is what I get when I extract the group code.

I'm running AutoCAD 2012 on Windows 7.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Search For Existing MLeader With Attribute Value

May 21, 2013

I'm working out a LISP for searching my entire drawing for a MLeader with a given value and then do something if it is found.

Currently, my code dies with 

; error: Automation Error. Description was not provided.

I do not know what is going wrong & I don't know what must be done next.
 
(DEFUN ML-SRCHSTR (TXT LBL / SS n_txt_LBL ENT P1 P2) ;|(ML-SRCHSTR TXT)|; (IF (SSGET "x" '((0 . "MULTILEADER"))) (PROGN (SETQ ss (VLA-GET-ACTIVESELECTIONSET (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)))) (VLAX-FORent ss(IF (VL-STRING-SEARCH txt (STRCASE (VLA-GET-TEXTSTRING ent))) (PROGN (VLA-CLEAR ss) (INITGET 1 "Yes No") (SETQ n_txt_LBL (STRCAT "
=>> " LBL " Label EXISTS! Add another " txt "? ") y_n (GETKWORD (strcat n_txt_LBL " [Yes/No]: ")) ) (IF(= y_n "Yes") (PROGN (ppa-L-

[Code]...

My MLeader has a _TagBox & it is the attribute of the _TagBox that I am trying to check/compare the "txt" value.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Attach Leader To Existing Block

Oct 24, 2013

Is there a way to attached an already exisiting placed block to a leader. If so, is there a way to do it to all the existing blocks, that are of the same block definintion, at once?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Serial Letters And Numbers From Existing Ones

Mar 2, 2013

Lisp file to get serial letters and numbers from existing ones,

I got a lisp file (attached) from experts in the form which does generate serial letters and numbers from existing ones.

The issue with this lisp file is that it doesn’t give the opportunity to choose the direction of numbering (top to bottom/bottom to top/left to right/right to left) as shown in the screenshot below

How this lisp can be developed to give the user the chance to choose the direction of numbering?

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved