Jump to content

Search the Community

Showing results for tags 'mtext'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

Found 50 results

  1. I've only been learning LISPing for a few weeks so C&C's are most welcome. LINK TO VIDEO: One of my most used LISPs is the LeaderToMleader.LSP. Found here. It was last updated many moons ago, so I decided to try learn and modify it to suit. Many thanks to the original author Lyle Hardin. I just need some guidance on how to get UCS working with it. EDIT. Using the TRANS fn. It works okay. Took a bit of tweaking but I got it. Please test. Here's a list of things I've changed at the top of the code: Main ones are: Multiple Selection - User can now select the LEADER and MTEXT together and no longer individually resulting in a much faster conversion. Strip text - Of formatting option - LM:UnFormat fn written by LeeMac. Annotation support - Program simply matches the (entget) object to that of the (entlast) object. With the help of AT:isAnnotative written by Alan J. Thompson. Case conversion - Built in fns using (load "TcaseSup.lsp") - OPTIONS: Titlecase Lowercase Uppercase Sentencecase toGglecase Keepcase Verts - Leader_To_Multileader now supports 2 or 3 points. (Old method was only 2). It uses the 1st, 2nd (if applicable) and last verts of the LEADER. The 4th vert or more, will get removed. Text Rotation - MTEXT rotation is now preserved. Undo levels - As opposed to one command at a time. PS. How easy would it be to calculate the distance between the start point of the LEADER point and pos of the MTEXT and then for each of the closest pairs make them an MULTILEADER. That would be cool. ;;; CADALYST 08/08 www.cadalyst.com/code ; Tip 2305: Leader_To_Multileader.lsp LEADER to Multileader (c) 2008 Lyle Hardin ; Pick an old style LEADER and text to create a new MLEADER entity and erase the old LEADER and text. ; March/2008 ;;; EDITED ON 15/04/2017 BY 3DWANNAB ; Reason for creating this, was to learn and create a LISP that I use on a regular basis. ; Commandline Syntax: Type "Leader_To_Multileader" OR "LTM" to run Program. ; ; ADDED - Case Conversion. ; OPTIONS: ; Titlecase Lowercase Uppercase Sentencecase toGglecase Keepcase. ; ; ADDED - Annotation support. Program simply matches the (entget) object to that of the (entlast) object. With the help of AT:isAnnotative written by Alan J. Thompson. ; ADDED - Custom LM:ssget fn written by LeeMac. ; ADDED - Multiple Selection. User can now select the LEADER and MTEXT together and no longer individually resulting in a much faster conversion. ; ADDED - Round off points - To nearest round number. That been 1. round fn written by Doug Broad. Additional credits to Joe Burke, Peter Toby. ; ADDED - Strip MTEXT - Of formatting option - LM:UnFormat fn written by LeeMac. ; ADDED - Text Rotation - MTEXT rotation is now preserved. ; ADDED - Undo levels - As opposed to one command at a time. ; ADDED - Picking of existing MLEADER to use as new style. ; RMB-SPACEBAR-ENTER to skip this step and use the current MLEADER style ; SETTINGS TRANSLATED IF PICKED: ; (vla-put-Layer newmleader existingMlLayer) ; (vla-put-ScaleFactor newmleader existingMlScale) ; (vla-put-StyleName newmleader existingMlStyle) ; (vla-put-TextWidth newmleader existingMlWidth) ; ; SETTINGS TRANSLATED IF NOT: ; (vla-put-Layer newmleader existingTxtLayer) ; (vla-put-TextRotation newmleader existingTxtRot) ; (vla-put-TextWidth newmleader existingTxtWidth) ; ; CHG - Changed to 'vla-get-TextString' as more robust. ; CHG - Moved new MLEADER to TEXT Layer as opposed to existing LEADER. ; CHG - Picking never fails, prompts user to keep picking until successful. LM:SelectIf fn written by LeeMac. ; FIX - ACADs built in functions to convert ill-formatted MTEXT creates a bug in the string result. LM:StringSubst by LeeMac. ; FIX - End position of MLEADER. ; FIX - Z coordinate to 0, resulting in no fuzzy text. ; FIX - Forces the MLEADER to be created from the 'LEADER arrowHead first' resulting in correct results all the time. ; FIX - Vertices, Leader_To_Multileader now supports 2 or 3 points. ; If 2 (Straight) it straightens the MLEADER up to the Y axis of the LEADER point for those LEADERS at an angle. ; If 3 (Dog Legged) it recreates those as they originally were. ; If <3 (Multiple) it recreates the 1st, 2nd & end point point of the original LEADER. The 4th vert or more, will get removed. ; NOTE: Not really any need for more than 3 points on an MLEADER, I don't think. ; ;;; KNOWN QUIRKS, BUGS ; Works in different UCSs, if you are fixing MTEXT & LEADERS which are upside down then the new MLEADER might be a little wacky. ; ;;; FUTURE ADDITIONS ; Convert based on how close the LEADER and MTEXT are away from each other. To enable multiple selection. ; ;;; COMMENT OUT ; First off, Big THANKS to Lyle Hardin for the original code. ; Big THANKS to LeeMac for the functions he has put up on his website. ; Finally getting the basics of this LISP'ing lark thanks to guys like him. ; Lots of other places on forums and Users too. To many users to mention. ; Let me know your thoughts on this Program or if you want to drop a Thank you. ; e. stephensherry147@yahoo.co.uk (defun c:LTM nil (c:Leader_To_Multileader)) (defun c:Leader_To_Multileader ( / *error* cmde entLeader entLeaderName entTxt entTxtName entTxtVlaObj existingMlScale existingMlStyle existingMlvlaObj existingMlWidth existingTxtLayer existingTxtRot existingTxtString existingTxtWidth ldxf10_1 ldxf10_2 ldxf10_last lstleaderlen lstleaderpts os ss1 ss2 ) (defun *error* (errmsg) (and acDoc (vla-EndUndoMark acDoc)) (and errmsg (not (wcmatch (strcase errmsg) "*CANCEL*,*EXIT*")) (princ (strcat "\n<< Error: " errmsg " >>")) ) (setvar 'cmdecho cmde) (setvar 'osmode os) ) (setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (or (vla-EndUndoMark acDoc) (vla-StartUndoMark acDoc)) (setq cmde (getvar "cmdecho")) (setq os (getvar "osmode")) (setvar 'cmdecho 0) (setvar 'osmode 0) (if (setq ss1 (car (LM:SelectIf (strcat "\nSelect an existing MULTILEADER to use as the new style\nor RMB-SPACEBAR-ENTER to use current: '" (getvar "cmleaderstyle") "'." ) (lambda ( x ) (eq "MULTILEADER" (cdr (assoc 0 (entget (car x)))))) entsel nil ) ) ) (progn (setq existingMlvlaObj (vlax-ename->vla-object ss1) existingMlLayer (vla-get-Layer existingMlvlaObj) existingMlStyle (vla-get-StyleName existingMlvlaObj) existingMlWidth (vla-get-TextWidth existingMlvlaObj) ) (if (/= T (AT:isAnnotative ss1)) (setq existingMlScale (vla-get-ScaleFactor existingMlvlaObj)) ) (princ (strcat "\nStyle to use: ' " existingMlStyle " '")) ) ) (initget "Titlecase Lowercase Uppercase Sentencecase toGglecase Keepcase") (setq ansCase (cond ( (getkword (strcat "\nChoose Text Case : [Title case/Lower case/Upper case/Sentence case/toGgle case/Keep case] <" (setq ansCase (cond ( ansCase ) ( "Keepcase" )) ) ">: " ) ) ) ( ansCase ) ) ) (initget "Keepformatting Removeformatting") (setq ansFromatting (cond ( (getkword (strcat "\nChoose Formatting : [Keep formatting/Remove formatting] <" (setq ansFromatting (cond ( ansFromatting ) ( "Keepformatting" )) ) ">: " ) ) ) ( ansFromatting ) ) ) (while (setq ss2 (LM:ssget "\nSelect 1 LEADER & 1 MTEXT: " (list "_:L" (append '( (-4 . "<OR") (0 . "MTEXT") (0 . "LEADER") (-4 . "OR>") ) ) ) ) ) (if (/= (sslength ss2) 2) (progn (alert "Select only 1 MTEXT and 1 LEADER.") (princ " >>> 'LTM' failed selection, try again ...")(princ) ) (progn (if (= (cdr (assoc 0 (entget (ssname ss2 0)))) "LEADER") (setq entLeader (entget (ssname ss2 0)) entTxt (entget (ssname ss2 1)) ) (setq entLeader (entget (ssname ss2 1)) entTxt (entget (ssname ss2 0)) ) ) (if (or (and (eq (dxf 0 entLeader) "LEADER") (eq (dxf 0 entTxt) "LEADER")) (and (eq (dxf 0 entLeader) "MTEXT") (eq (dxf 0 entTxt) "MTEXT"))) (progn (alert "Please, check your Selection !\n\nSelect only 1 MTEXT and 1 LEADER.") (princ " >>> 'LTM' failed selection, try again ...")(princ) ) (progn (setq entLeaderName (dxf -1 entLeader) entTxtName (dxf -1 entTxt) existingTxtLayer (dxf 8 entTxt) entTxtVlaObj (vlax-ename->vla-object entTxtName) existingTxtString (vla-get-TextString entTxtVlaObj) existingTxtWidth (dxf 41 entTxt) existingTxtRot (dxf 50 entTxt) lstleaderpts (vl-remove-if-not '(lambda (p) (eq (car p) 10)) entLeader ) lstleaderlen (length lstleaderpts) ldxf10_1 (cdr (car lstleaderpts)) ldxf10_1 (mapcar '(lambda (x) (round x 1) ) ldxf10_1 ) ldxf10_2 (if (>= lstleaderlen 3) (cdr (nth (- lstleaderlen 2) lstleaderpts)) ) ldxf10_2 (mapcar '(lambda (x) (round x 1) ) ldxf10_2 ) ldxf10_last (if (< lstleaderlen 3) (list (car (dxf 10 entTxt)) (cadr ldxf10_1) (caDDr (dxf 10 entTxt))) (list (car (dxf 10 entTxt)) (cadr ldxf10_2) (caDDr (dxf 10 entTxt))) ; (list (car (dxf 10 entTxt)) (cadr ldxf10_1) 0) ; (list (car (dxf 10 entTxt)) (cadr ldxf10_2) 0) ) ldxf10_last (mapcar '(lambda (x) (round x 1) ) ldxf10_last ) ) (cond ((= "Keepformatting" ansFromatting) ) ((= "Removeformatting" ansFromatting) (setq existingTxtString (LM:UnFormat existingTxtString nil)) ) ) (progn (if (>= lstleaderlen 3) (progn (command "._MLEADER" "_L" "_H" "_O" "_M" 3 "_A" "_N" "_X" "_non" (trans ldxf10_1 0 1) "_non" (trans ldxf10_2 0 1) "_non" (trans ldxf10_last 0 1) "") ) (progn (command "._MLEADER" "_L" "_H" "_O" "_M" 2 "_A" "_N" "_X" "_non" (trans ldxf10_1 0 1) "_non" (trans ldxf10_last 0 1) "") ) ) (setq newmleader (vlax-ename->vla-object (entlast))) (cond ((= "Titlecase" ansCase) (setq existingTxtString (acet-tcase-change-string existingTxtString "TITLE")) ) ((= "Lowercase" ansCase) (setq existingTxtString (acet-tcase-change-string existingTxtString "LOWER")) ) ((= "Uppercase" ansCase) (setq existingTxtString (acet-tcase-change-string existingTxtString "UPPER")) ) ((= "Sentencecase" ansCase) (setq existingTxtString (acet-tcase-change-string existingTxtString "SENTENCE")) ) ((= "toGglecase" ansCase) (setq existingTxtString (acet-tcase-change-string existingTxtString "TOGGLE")) ) ((= "Keepcase" ansCase) (setq existingTxtString existingTxtString) ) ) (setq existingTxtString (LM:StringSubst "\\\H" "\\\h" existingTxtString)) (vla-put-TextString newmleader existingTxtString) (vla-put-TextRotation newmleader existingTxtRot) (if ss1 (progn (command "._MATCHPROP" ss1 (entlast) "") (vla-put-TextWidth newmleader existingMlWidth) ; (vla-put-StyleName newmleader existingMlStyle) ; (vla-put-Layer newmleader existingMlLayer) (if (/= T (AT:isAnnotative ss1)) (vla-put-ScaleFactor newmleader existingMlScale) ) ) (progn (vla-put-Layer newmleader existingTxtLayer) (if (/= existingTxtWidth 0) (vla-put-TextWidth newmleader existingTxtWidth) ) ) ) (command "_.erase" entTxtName "") (command "_.erase" entLeaderName "") (command "_.move" (entlast) "" '(0 0 1e99) "" "_.move" "_p" "" '(0 0 -1e99) "") (princ " >>> 'LTM' has done the business ...")(princ) ) ) ) ) ) ) (*error* nil) (princ) ) ;; Unknown Autor (defun dxf (code elist) (cdr (assoc code elist)) ) ;; Doug Broad ;; additional credits Joe Burke, Peter Toby (defun round (value to) (setq to (abs to)) (* to (fix (/ ((if (minusp value) - +) value (* to 0.5)) to))) ) ;;--------------------=={ String Subst }==--------------------;; ;; ;; ;; Substitutes a string for all occurrences of another ;; ;; string within a string. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; new - string to be substituted for 'old' ;; ;; old - string to be replaced ;; ;; str - the string to be searched ;; ;;------------------------------------------------------------;; ;; Returns: String with 'old' replaced with 'new' ;; ;;------------------------------------------------------------;; (defun LM:StringSubst ( new old str / inc len ) (setq len (strlen new) inc 0 ) (while (setq inc (vl-string-search old str inc)) (setq str (vl-string-subst new old str inc) inc (+ inc len) ) ) str ) ;; ssget - Lee Mac ;; A wrapper for the ssget function to permit the use of a custom selection prompt ;; ;; Arguments: ;; msg - selection prompt ;; params - list of ssget arguments (defun LM:ssget ( msg params / sel ) (princ msg) (setvar 'nomutt 1) (setq sel (vl-catch-all-apply 'ssget params)) (setvar 'nomutt 0) (if (and sel (not (vl-catch-all-error-p sel))) sel ) ) ;;---------------------=={ Select if }==----------------------;; ;; ;; ;; Provides continuous selection prompts until either a ;; ;; predicate function is validated or a keyword is supplied. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; msg - prompt string ;; ;; pred - optional predicate function [selection list arg] ;; ;; func - selection function to invoke ;; ;; keyw - optional initget argument list ;; ;;------------------------------------------------------------;; ;; Returns: Entity selection list, keyword, or nil ;; ;;------------------------------------------------------------;; (defun LM:SelectIf ( msg pred func keyw / sel ) (setq pred (eval pred)) (while (progn (setvar 'ERRNO 0) (if keyw (apply 'initget keyw)) (setq sel (func msg)) (cond ( (= 7 (getvar 'ERRNO)) (princ "\nMissed, Try again.") ) ( (eq 'STR (type sel)) nil ) ( (vl-consp sel) (if (and pred (not (pred sel))) (princ "\nInvalid Object Selected.") ) ) ) ) ) sel ) ;;-------------------=={ UnFormat String }==------------------;; ;; ;; ;; Returns a string with all MTEXT formatting codes removed. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; str - String to Process ;; ;; mtx - MTEXT Flag (T if string is for use in MTEXT) ;; ;;------------------------------------------------------------;; ;; Returns: String with formatting codes removed ;; ;;------------------------------------------------------------;; (defun LM:UnFormat ( str mtx / _replace rx ) (defun _replace ( new old str ) (vlax-put-property rx 'pattern old) (vlax-invoke rx 'replace str new) ) (if (setq rx (vlax-get-or-create-object "VBScript.RegExp")) (progn (setq str (vl-catch-all-apply (function (lambda ( ) (vlax-put-property rx 'global actrue) (vlax-put-property rx 'multiline actrue) (vlax-put-property rx 'ignorecase acfalse) (foreach pair '( ("\032" . "\\\\\\\\") (" " . "\\\\P|\\n|\\t") ("$1" . "\\\\(\\\\[ACcFfHLlOopQTW])|\\\\[ACcFfHLlOopQTW][^\\\\;]*;|\\\\[ACcFfHLlOopQTW]") ("$1$2/$3" . "([^\\\\])\\\\S([^;]*)[/#\\^]([^;]*);") ("$1$2" . "\\\\(\\\\S)|[\\\\](})|}") ("$1" . "[\\\\]({)|{") ) (setq str (_replace (car pair) (cdr pair) str)) ) (if mtx (_replace "\\\\" "\032" (_replace "\\$1$2$3" "(\\\\[ACcFfHLlOoPpQSTW])|({)|(})" str)) (_replace "\\" "\032" str) ) ) ) ) ) (vlax-release-object rx) (if (null (vl-catch-all-error-p str)) str ) ) ) ) ;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-annotative-using-lisp-or-vlisp/m-p/3266716#M301077 ;; Check if entity is annotative and which accounts for objects that were once annotative but are no longer. ;; ename - ename to check (returns T if annotative) ;; Alan J. Thompson (defun AT:isAnnotative (ename / check) (and (setq check (cdr (assoc 360 (entget ename)))) (setq check (dictsearch check "AcDbContextDataManager")) (setq check (dictsearch (cdr (assoc -1 check)) "AcDb_AnnotationScales")) (assoc 350 check) ) ) ;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-annotative-using-lisp-or-vlisp/m-p/3266684#M301075 ;; By User pbejse ;; (IsAnno-p ;; (setq itm (vlax-ename->vla-object (Car (entsel)))) ;; ) (defun IsAnno-p (ent / exd ano) (vl-load-com) (and (eq (vla-get-HasExtensionDictionary ent) :vlax-true) (setq exd (vla-GetExtensionDictionary ent) exd (vla-item exd "AcDbContextDataManager") ano (vla-item exd "ACDB_ANNOTATIONSCALES") ) (not (zerop (vla-get-Count ano))) ) ) (load "TcaseSup.lsp") (vl-load-com) ;; End (princ (strcat "\n:: Leader_To_Multileader.lsp edited on " (menucmd "m=$(edtime,0,DD-MO-yyyy)") " by 3dwannab (stephensherry147@yahoo.co.uk) loaded ::" "\n:: Type \"Leader_To_Multileader\" OR \"LTM\" to run Program ::" ) ) (princ) MLEADER Test Drawing.dwg
  2. Hi, Please see attached the Fuzzy Text Problem.dwg Fuzzy Text Problem.dwg The bottom of the two text (MTEXT) has a Z value of 0. When exploded to TEXT it has a value of -0.00000454. It appears FUZZY in AutoCAD for this reason. 2d wireframe is set DVIEW is ok also. FLATTEN or my routine below for putting objects to Z won't work either. (defun C:FX_Flatten_To_Z () (command "_.UCS" "") (command "_.move" "_all" "" '(0 0 1e99) "" "_.move" "_p" "" '(0 0 -1e99) "") (princ) ) Any insight to this problem would be great, thanks.
  3. Hello, I'm trying to create a command line for a tool bar button that will create mtext but middle justify it using "J" and "MC" inside the mtext command. Anyone know how to do that?
  4. Howdy howdy, Any time I would like to create an EXACT height over the x2.5 that can be selected in the MTEXT Editor dropdown, it gives me the minor annoyance of having to do the process twice. The first time I input my line spacing (With 'exact' selected), apply, and close the dialogue box, the text gets all scrunched up. It will stay like this until I go BACK into the line space dialogue box and input the amount I want again. Attached are pictures of the described process. Thoughts? [attachment=48613:name] [attachment=48614:name] [attachment=48615:name] [attachment=48616:name] [attachment=48617:name] *placed in code wrap to save space due to the amount of pictures
  5. Hi all, whenever I enter the MTEXT editing function, then type a letter on any given line of text, that line rotates to the world UCS. This makes typing almost impossible, as the overlapping text can't be read clearly. Any suggestions? I'm using AutoCAD 2013 for Mac and looking at my drawing with a rotated UCS.
  6. As posted over at theSwamp, I thought I'd post it here for you guys also CopyText.lsp The program will allow a user to copy the text content from a source object to a selection of destination objects or swap the text content between two objects. The user may select from Text, MText, Attribute, or Multileader objects. Upon choosing 'Settings' the user can alter whether source object formatting should be retained upon copying/swapping to/with objects which permit the use of such formatting. Ideas/criticism/feedback are, as always, welcome Enjoy! Lee CopySwapTextV1-6.lsp
  7. Hello everybody, This is my first post on CADTutor. I've been reading alot here even before I became a member, but it is time for me to join the community with a question since I cannot find the exact answer to mine. Question: Is it possible to sum numbers in Mtext fields created with lisps? AT.LSP OT.LSP I edited them to suit my needs with prefix and suffix and decimal precision (they are in the core the same, originally made by JTB), one is displaying area of selected polyline (AT.lsp) and the other perimeter/length (OT.lsp). I would like to preserve possibility of field updating so when polyline/area is changed I just enter regenall. I copied Mtext fields maually to "oldstyletable" made from lines and mtext, mtext fields. See attached dwg for example. I've seen this thread: http://www.cadtutor.net/forum/showthread.php?43699-Sum-Text-Strings-to-Text-Field... I tried all the lisps but none are applicable to my problem. I get only #### even after regen (I think it's maybe because of prefix and suffix, but don't know). I've managed to work only with text and then my updating Mtext fields are, for sure, gone. Please advise. TEST1.dwg
  8. Hi all, I would like to know how I can replace a MTEXT (not TEXT) of an attribute by selecting a TEXT/MTEXT. Thank you so much !
  9. HFBandit

    MTEXT "squashing" on move

    Hi I'm running LT 2017 and have encountered an issue when moving MTEXT. As I move the text, the transparent "placeholder" text is squashing vertically. This makes it hard to know where the end position of the text will actually be. Hopefully the attached image will clarify what I mean.
  10. I have searched all over for the answer to this but with no success. When I am in my VP and double-click the MTEXT it stays horizontal. Then when I type any letter or spacebar it rotates to East. My VP is rotated with North pointing NW. I have tried MTEXTFIXED I have tried MTEXTFIXED . When I try to change to OldEditor it says that it cannot acknowledge the font, which is Hand. Hand is our special type of font that we use. How on earth do I get the text to stay horizontal while editing? I can't remember her name Lynn or something, said that its frustrating standing on your head to edit text. As always, any and all help/comments are welcome. Thank you. Miller
  11. Hello. I want to change line space factor for all the mtext objects in a hole bunch of drawings by script. I found this lisp and it works fine but only by manually selecting the mtext objects. (setq vla_mtext (vlax-ename->vla-object (setq mymtext (car (entsel))))) (vla-put-LineSpacingFactor vla_mtext 0.5) Can this lisp be changed so it changes all mtext objects found in the drawing, or is there another way? Thanks
  12. We are getting some serious issues with plotting in Autocad. In one of our drawings, someone dimensioned the diameter of a circle. Here is where things get weird: It showed up in Paper space. It showed up when it was plotted to our Ricoh printer. When it was plotted to our HP Designjet the MText was gone. No dimension line, no text, nothing. The weirder thing is this behavior is inconsistent. I've plotted it on two separate computers and it shows up just fine. But sometimes it won't show up at all. Has any one else experienced this issue or a similar issue? Or does anyone know any reason that MText will sometimes not show up when plotted to a certain printer?
  13. I am trying to write a routine to "simulate" MText command in lisp using predefined Text Height (2.0mm in this case for 1:1 scale) and text Style. I started with this code: (defun C:test (/ Height Style) (setvar "cmdecho" 1) (setq Height (* (getvar "DIMSCALE") 2.0 )) (setq Style "My_Style") (command "._MTEXT" pause "H" Height "S" Style pause) (princ) ) The text style seems to work but the Text Height doesn't change. Could anyone help please?
  14. I've attached a sample of some text we got in a CAD drawing from one of our clients. For whatever reason, all the standard text is showing up as vivaldi text for me. A coworker said he was able to open up the drawing and everything was showing up fine?? If you look in the contents under properties there's a slash pxqc prefix that I've never seen before. It's like Vivaldi was set up an override to the standard text style. So even if I change the text style to something else, the Vivaldi text persists. So the only way I see to change it back to something different is to open every mtext in the drawing and change the override text style to something different. That works but.... if there's some way to remove the text overrides all at once it would save me alot of time. Has anyone seen this before? Thank you! -ChriS ScrewyTextSample.dwg
  15. I'm about to receive a bunch of borehole data for a bigger project with x,y coordinates in state plane for each hole and I believe it will be sent as an Excel file. I'd like to add a center-justified text consisting of the borehole name at the x,y coordinate where it should go so I can quickly check out the location of a hole and then look up its other properties by name in the Excel sheet. So far, I'm thinking about concatenating the cells and adding spaces in a separate column in excel so that for each hole I have something like: text j mc 0 x-coordinate,y-coordinate BH120 in a single cell. That way I can copy and paste that line at the CAD command prompt and skip a ton of key strokes going through the text options. I've done a similar workaround, inspired by someone here on the forums, when working with line segments where clients have sent me endpoints in Excel format. It's been great because it's transparent enough that I can forward my spreadsheet on to any one of my coworkers and have them duplicate the process without having to worry about a couple of people in my work group who only have LT and can't use LISPs (I think?). The difference is that while you can exit a line command by putting a space after that entry above, I think the only way to end the text command might be by pressing enter twice and I don't know if there's a way to just concatenate a couple of enters at the end of a line like I can a couple of spaces. The question is, is there a quick cheat that would let me do everything by copying and pasting multiple lines formatted as above all at once from excel without having to press enter after each hole? Is there an arraypath type command that's more well-suited to this instead, since I do have x,y coordinates?
  16. Hi! I have a text box containing mText with fields. I have drawn up the multiline box I want to have the text in, problem is that when the fields change the text gets longer and therefor makes the box bigger leading to my text no longer staying within the size its supposed to. Is there a way to fit mtext? Force it to stay within the set border and if more rows than fit are added, shrink the text? Thank you!
  17. Currently, I have an Excel table. Numbers of column contains 0 or 1. I have to copy column by column into notepad and then copy the notepad contain to CAD. After that, I have serval individual column of Mtext. Then I further explode them into text. A numbers of individual text are pasted on CAD and this is what I want. However, if I do copy multiple column into notepad, the result is a whole Mtext which is containing all columns. I explode the Mtext and I will obtain multiple line of text. I am searching for a lisp to convert/separate Mtext to individual text. For more advance, I want these 1 and 0 located in different destination point from excel to CAD by a lisp.
  18. I have a question about MTEXT... specifically the tab and indents at the top of the MTEXT input window, how can I set the "tolerance" of the ruler? currently the ruler shows 1/8" increments and will not allow me to set new Tabs between the tick marks. I want to be able to click new tabs at 1/16" increments. Is there a setting for the tolerance or a good way to set tabs with out manually having to type them in the paragraph window? Thanks in advance!!
  19. I am trying to QLATTACH some errant leaders to their respective text. In my QLEADER (S)ettings I have: Annotation Type: Mtext Options: prompt for width Reuse: None Leader Line & Arrow Leader Line: straight Points: 2 Arrowhead: closed filled First segment constraint: any angle Second segment constraint: horizontal Multiline Text Attachment Text on left side: middle of bottom line Text on right side: middle of top line Underline bottom line: unchecked However, when I QLATTACH the leader to text, it wants to add a point to the leader and either underline the bottom line (which is unchecked, remember) or maybe it is trying to associate with the middle of the bottom line instead of the middle of the top line (text is all justified to top left). See attached. The top leader and mtext is what it should look like; the bottom leader and mtext is what I get when I try to QLATTACH. I'm probably overlooking something simple, but I can't figure out what it may be. Something in STYLE, maybe?
  20. Hi all, I have about 140 layouts and I've just been asked to add a piece of information (some mtext) to every other layout, any ideas? Any help is appreciated, Dave
  21. Currently using Autocad 2012 vanilla. Would like to add round brackets/parentheses around multiple lines "mtext". It is very common to show line annotations this way in Australia. Right now I use two mtext with different text height. The parentheses' text height is obviously larger to suit the number of lines. I've tried OLE microsoft equation via "insert objects" in autocad but it: does not like my "Autocad only valid font" cannot be rotated. I can probably program this in AutoLISP but it will take me some time. Is there an existing solution? PS: Yes, I am aware of the typo, i.e. missing a minute ' symbol.
  22. Help, I keep getting this stupid error no function definition even though I have clearly defun it in my lisp. (defun ISOCP3TEXT () (command "-style" "isocp3" "isocp.shx" "3" "1" "0" "no" "no") ) (defun ISO3 () (ISOCP3TEXT) (setvar "clayer" "0") (setq pt1 (getpoint "")) (initdia) (command ".mtext" pt1) ) (defun c:meh () (ISO3) If you are wondering, I am using meh which may seem redundant but in my main source code, I actually need to call up iso3 due to a dialog box settings thing. For some reason, when I try to run meh, I keep getting ; error: no function definition: ISO3 when clearly I do have a defined function ISO3. Help please.
  23. I have a Detail Bubble dynamic block with MTEXT. Every time I use the Reference Manager, the MTEXT does not show up at the original location. I couldn't upload the pic to show what I mean.
  24. I have the command syntax in my lisp file to create a splined Mleader but I when I try to add text to the Mleader using the Mleader settings, I end up getting text at the landing. How can I put the text at the arrowhead?
  25. I have ALMOST 1000 unique mtexts. I want to append a second line, with the same text, to ALL of them at once. All the current mtexts are different, with different character lengths, so I cannot use 'find and replace'. However, they are are all on the same layer and easily selectable as a group. Is there an easy way to do this? Lisp or otherwise? i.e. originals: "12345" "abcde" "..." desired results: "12345 HOUSE" "abcde HOUSE" "... HOUSE" Thanks