Search the Community
Showing results for tags 'text'.
-
Request: Lisp command that can quick swap text between two objects
plackowski posted a topic in AutoLISP, Visual LISP & DCL
I'm looking for a lisp command that can quick swap text between two objects, be they text, mtext, or multi-leader text. So upon running, you click on the two objects, and the text from object A moves to object B, and the text from object B moves to object A, where object A and object B can be different object types. -
field Convert dwgprops item to a float in field formula
MastroLube posted a topic in AutoCAD General
Hi there! I have a lisp that saves a custom variable in my dwg. (the custom tab in dwgprops command) I want to insert that value in a field and manipulate it a little bit, but it's a string. Is it possible to convert it to a float inside the formula box in the field editor? I've tried with autolisp (atof ...) but it's not working. Thanks! Dennis -
Hatching around text (Options?)
ILoveMadoka posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Once upon a time, Autocad used to hatch around text objects like this In Autocad 2022 it hatches around the mtext like this It seems to be connected to the text frame. Short of exploding the Hatch, drawing a polyline around the text and trimming, is there a setting or way to hatch like the first example? Another workaround is to explode the mtext first but that is problematic with our standards. Converting back to Mtext adds even another step that we'd prefer not to have to do.. Please advise. -
Excel Table. Using text style "hand". How do I change font to archD?
MillerMG posted a topic in AutoCAD Beginners' Area
Our company uses "hand" as the style for all our projects. I need to import a table from excel with excel formatting. After I change all the text to "hand" style I can't figure out how to change the font. Any help would be greatly appreciated!! -
AutoCAD Table - Link Text With Equation
Walker140 posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Hello, I have created a table within AutoCAD. I have written some words in cell "A1", I would like to display the same words in another cell using an equation "=A1". When I type the "=A1" equation the cell displays "####" Is there anyway to make this work? possibly using fields? Thanks -
hello everybody , hope u all are great ... i have this lisp to get sum of some texts in autocad by choosing them one by one , but instead i wanna select those texts in one time by one selection click for them all ... i really appreciate ur help thanks in advance ;; wrriten by dlanorh from cadtutor (defun rh:em_txt ( pt txt lyr sty tht xsf) (entmakex (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 10 pt) (cons 1 txt) (if lyr (cons 8 lyr)) (if sty (cons 7 sty)) (if tht (cons 40 tht)) (if xsf (cons 41 xsf)) );end_list );end_entmakex );end_defun (vl-load-com) (defun c:t+ ( / *error* sv_lst sv_vals ent elst el num xsf ans tot qflg nlst sel pt txt) (defun *error* ( msg ) (mapcar 'setvar sv_lst sv_vals) (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nAn Error : " msg " occurred."))) (princ) );end_defun (setq sv_lst (list 'cmdecho 'osmode 'dynmode 'dynprompt) sv_vals (mapcar 'getvar sv_lst) );end_setq (mapcar 'setvar sv_lst '(0 0 3 1)) (while (not tot) (setq el (entget (setq ent (car (entsel "\Select First Text Number Entity : "))))) (cond ( (wcmatch (cdr (assoc 0 el)) "*TEXT") (cond ( (= (cdr (assoc 0 el)) "TEXT") (setq num (atof (getpropertyvalue ent "TextString")) xsf (cdr (assoc 41 el)))) (t (setq num (atof (getpropertyvalue ent "Text")) xsf 1.0)) );end_cond (cond ( (zerop num) (setq num nil) (alert "Text Entity NOT a number")) (t (setq tot num))) ) (t (alert "Not a Text Entity")) );end_cond (cond (num (setq nlst (cons ent nlst)))) );end_while (while (not qflg) (setq sel (entsel "\nSelect Next Text Number Entity : ")) (cond ( (not sel) (initget "Yes No") (setq ans (cond ( (getkword "\nSelection Finished [Yes/No] <No>")) ("No"))) (if (= ans "Yes") (setq qflg T)) ) );end_cond (cond ( (and (not qflg) sel) (setq elst (entget (setq ent (car sel)))) (cond ( (and (wcmatch (cdr (assoc 0 elst)) "*TEXT") (not (vl-position ent nlst))) (cond ( (= (cdr (assoc 0 elst)) "TEXT") (setq num (atof (getpropertyvalue ent "TextString")))) (t (setq num (atof (getpropertyvalue ent "Text")))) );end_cond (cond ( (zerop num) (setq num nil) (alert "Text Entity NOT a number"))) ) ( (vl-position ent nlst) (alert "Already Selected") (setq num nil)) (t (alert "Not a Text Entity")) );end_cond (if num (setq tot (+ tot num) nlst (cons ent nlst) num nil)) ) );end_cond );end_while (cond ( (and tot qflg) (setq pt (getpoint "\nSelect Total Insertion Point : ") txt (if (zerop (rem tot 1.0)) (rtos tot 2 0) (rtos tot 2 3)) );end_setq (rh:em_txt pt txt (cdr (assoc 8 el)) (cdr (assoc 7 el)) (cdr (assoc 40 el)) xsf) (if nlst (foreach o (mapcar 'vlax-ename->vla-object nlst) (vla-delete o))) ) );end_cond (mapcar 'setvar sv_lst sv_vals) (princ) );end_defun
-
Hi all. I hope everybody is safe during this Covid-19 pandemic. I need some help. How do i move the text (BEFORE picture) and create a new line? The distance between the text is fix or as long as user can read it. How do i create the lines? I'm new to Autolisp, so please avoid giving example in Visual Lisp (vlx). Thanks.
-
When I am using UCS by object and for that selecting the text it shows Z axis on text. but in the text properties it is not there if I change the value of Z also nothing changing same problem exist. Not only the UCS, when i am using Lee Mac Align Text to Curve it is not coming properly. for that I am fixing the problem am using Lee Mac Text2MText Upgraded with single selection or explode the text and making again Text2MText. while flattening the text is self-exploding. for this how can i remove all text z axis value at single time.....???? Test.dwg
- 2 replies
-
- text2mtext upgraded
- leemac
-
(and 1 more)
Tagged with:
-
I found valuable lisp for auto creation block. I want to improve this lisp to following requirement * block selected object individually, not in one block thanks AUTO-BLOCK.LSP
-
Hi, I would like to know some help. 01 - Is there a possibility in this Lee Mac lisp, Automatically Label Attributes, that it can be changed so that every time I open a different file it asks me about the increment, prefix and suffix settings? Because in the current way it always loads the pre-configuration that is already in lisp. I don't want to have to edit the lisp to configure the numbers for each file. Note: I use attributed blocks and multileader blocks. 02 - I also use the Lisp Incremental Numbering Suite, I would like to know if the option for multileaders can be added. As the current options are only for text, mtext and blocks. For my use multileaders are more interesting. Because the use of block with attributes will have to be manually making the leader lines to indicate their positions and references after their insertion and when you have many blocks end up wasting valuable time. I would like to know if it is possible to make any of these changes, since lisps have many lines. Note: Sorry for the google translation. #NumIncV3-9.lsp AutoLabelAttributesV1-4.lsp
-
hello everyone , hope u all doing so great ... my problem here that i want easy way to insert numbers in autocad without trying to make texts or adjust them .. i wanna lisp make the number i press from keyboard be inserted into text or mtext and i just click the location of that text in cad ... hope somebody could help me in this ... thanks in advance
-
This mtext won't rotate. When I use the rotate command, the text moves around a point, but stays right side up the whole time. I remember this happening with xrefs as well. Anyone know what's happening here?
-
I re-opened a dgn I haven't touched in months and when I started looking at the text all of the labels/text changed their style to 'Fancy'. I opened up other dgn's from different projects and every single one is 'Fancy' text. I recently updated Microstation (update 15) but not sure if this has anything to do with it. Is there anyway to revert these text changes?
-
- microstation
- text
-
(and 1 more)
Tagged with:
-
please refer the attached cad file below. on the left is output text given by software at specific x, y distance from center of the circle. i need a lisp routine that will produce results similar to what i have mentioned on right side so that drawing will be easy to read. i have done this manually, but it will take days to complete like this as area is too big. THE TEXT SHOULD NOT OVERLAP TO EACH OTHER AS WELL AS NEARBY POLYLINES. Please help ASAP. Thank You. Drawing1.dwg
-
- move
- overlapping
-
(and 1 more)
Tagged with:
-
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
-
I saw this autolisp from Lee Mac on this forum, this lips routine allows to change existing text to anything instantly, i would like to know if any body wants to help me to make this lisp routine to select top text and change it then select bottom text and change it instantly too, thank you very much in advance, I have # at top of pipe reducer and a # at bottom of the reducer too, so I need to type 330 and click on the # top text and change to 3" then click on the bottom # and changed to 300, thank you again from Mr, Lee Mac but it work only on one text at the time. (defun c:req ( / ent enx ) (while (progn (setvar 'errno 0) (setq ent (car (entsel))) (cond ( (= 7 (getvar 'errno)) (princ "\nMissed, try again.") ) ( (null ent) nil) ( (not (wcmatch (cdr (assoc 0 (setq enx (entget ent)))) "TEXT,MTEXT")) (princ "\nPlease select a text or mtext object.") ) ( (entmod (subst '(1 . "REQUIRED") (assoc 1 enx) enx))) ) ) ) (princ) )
- 24 replies
-
Adding Dynamic updating to text change LISP? Thanks
tmelancon posted a topic in AutoLISP, Visual LISP & DCL
Hey guys I found this LISP routine that allows me to change text in a drawing to anything I specify. Works great, however. My question is how do I code in here so the text updates dynamically as I click on them, instead of dashing them and waiting for user to hit enter for the changes to appear. (defun c:req ( / v1 v2 v3 newtx nme oldtx) (setvar "cmdecho" 0) (prompt "\nPick text to be changed.") (setq v1 (ssget '((0 . "TEXT")) )) (setq newtx "REQUIRED") (setq newtx (cons 1 newtx)) (setq v2 0) (if (and v1 newtx) (while (< v2 (sslength v1)) (setq nme (ssname v1 v2)) (setq oldtx (assoc 1 (entget nme))) (setq v3 (entget nme)) (entmod (subst newtx oldtx v3)) (entupd nme) (setq v2 (+ v2 1)) ) ) ) -
Hello all, I have a file where the height of certain points is annotated as text. The precision is 0.0001 which is too much. I have like for example a text line containing 13.6489. Would it be possible to adapt all text entities at once? and maybe even a correct round off? If i could shorten the string to 13.64 that would be ok, but even better would be 13.65 If not, there are also blocks (crosses) which have the height as Z attribute. Is it possible to extract that Z coordinate and annotate it? Thanks in advande
-
I want to change the text "A" in my dynamic block to "B,C,D,E,..." When i click on a blue arrow. and the text "16 A" to "20 A , 25 A, ..." When i click on another blue arrow. what is the best way to do this ?
-
Hello Everyone! I am using vanilla AutoCAD 2017. I have recently done a hydrographic survey, so I have a drawing full of depths (text). Wondering if anyone can point me to a lisp routine that can color code the text based on a range. For example any depths between 10 and 20 is green or any depths between 20 and 30 are red. Thanks in advance.
-
Make line by user input (length) and add text under the line.
Sheep posted a topic in AutoLISP, Visual LISP & DCL
Hi to all. I've learned alot from this forum and i manage to make a lisp by reading this forum. But for this matter (refer image), i have no idea how to do it. I know about GETDIST to get the distance (setq Dd (getdist "\nPick first point)) and it will print out 30. 1. How do i make a line with length (user input) with datum of a value (user input)? 2. How do i created the text ( distance, level and additional text such as cut area) under the line? Let say i want to enter the length (or height?) as 20.0 with a caption. I want to enter the value and caption with a comma between the word (e.g: 20.0,borderline). 3. If i only enter only the value (no caption), how do i use the value ( car, caddr ?) and LISP will still accept it. 4. How do i space the gap between distance (0.00) and height ( 20.0). 5. Should i use GETPOINT fot the first point or straight away GETDIST to create the text? Thank for your answer and time. I've no knowledge on VL@ActiveX, can you please guide me using non VL sample. -
I have this block of text as you can see in the image below, and in the window show me this "VIGA V-SS01 (.25X .50)", BUT I DONT WANT THAT SHOW ME THIS. I want to the program ask me a question first, for example: What is the name? so I will set the answer of this question in the block I have. SO, I want to have this in the window "VIGA V- (AND THE ANSWER OF THE QUESTION)" EXAMPLE: Computer: What is the name? User write: L22 Then, that will show me: "VIGA V- L22" I will glad if you can help me, If you have already notice, I dont know to much about the topic.
-
Im beginner, I have this: (setq p1 (getpoint "\nPunto Inicial:")) (setq p2 (polar p1 (* 1.5 pi) 0.5)) (entmakex (list '(0 . "line") (cons 10 p1) (cons 11 p2) '(62 . 2))) So, the line I drawn is the yellow one below in the image. And, the text I want put is the magenta one. how can I do this? Thanks for your help
-
Aligned Dimensions from a line to a perpendicular line, with centered text.
Jean-Lévy Plante posted a topic in AutoLISP, Visual LISP & DCL
I would like to modify this lisp script so that the dimension has a centered text instead of on a side of the dimension. But i don't know how. (defun c:HD (/ HD_LineHouse HD_LineProperty HD_Point1 HD_BasePoint1 HD_Text1 HD_Point2 HD_BasePoint2 HD_Text2 HD_ActiveDoc HD_ActiveSpace) (if (and (setq HD_LineHouse (car (entsel "\nSelect house line : "))) (setq HD_LineProperty (car (entsel "\nSelect property boundary: "))) (= (vla-get-ObjectName (setq HD_LineHouse (vlax-ename->vla-object HD_LineHouse))) "AcDbLine") ) (progn (setq HD_LineProperty (vlax-ename->vla-object HD_LineProperty)) (if (not (vl-catch-all-error-p (setq HD_Point1 (vl-catch-all-apply 'vlax-curve-getClosestPointTo (list HD_LineProperty (setq HD_BasePoint1 (vlax-safearray->list (vlax-variant-value (vla-get-StartPoint HD_LineHouse))))))))) (progn (setq HD_Point2 (vlax-curve-getClosestPointTo HD_LineProperty (setq HD_BasePoint2 (vlax-safearray->list (vlax-variant-value (vla-get-EndPoint HD_LineHouse)))))) (setq HD_Text1 (polar HD_Point1 (angle HD_BasePoint1 HD_Point1) 0)) (setq HD_Text2 (polar HD_Point2 (angle HD_BasePoint2 HD_Point2) 0)) (vla-StartUndoMark (setq HD_ActiveDoc (vla-get-ActiveDocument (vlax-get-acad-object)))) (vla-put-TextPosition (vla-AddDimAligned (setq HD_ActiveSpace (vla-get-Block (vla-get-ActiveLayout HD_ActiveDoc))) (vlax-3d-point HD_BasePoint1) (vlax-3d-point HD_Point1) (vlax-3d-point HD_Point1)) (vlax-3d-point HD_Text1)) (vla-put-TextPosition (vla-AddDimAligned HD_ActiveSpace (vlax-3d-point HD_BasePoint2) (vlax-3d-point HD_Point2) (vlax-3d-point HD_Point2)) (vlax-3d-point HD_Text2)) (vla-EndUndoMark HD_ActiveDoc) (mapcar 'vlax-release-object (list HD_ActiveSpace HD_ActiveDoc)) ) ) ) ) (princ) ) HD-Automatic Dimension.LSP -
Rotating Text around base point based on azimuth of 3D polyline
cartographer posted a topic in AutoLISP, Visual LISP & DCL
Hi guys & gals, I came across a very repetitive problem. While working with a certain type of software data is output to *.dxf as set of 3D polylines and text. From the level of software I work with, I cannot configure any text formatting details. Hence an idea to ask You few questions. 1. Is there any way of rotating text based on azimuth of a 3Dpolyline which lies within 0.3m distance from the text base? Did someone ever came across LISP of this type ? 2. is there any other (more effective) way than OVERKILL to get a rid of duplicated text ? Thank you in advance ! Regards, Adam, Geophysicist.