AutoCAD Visual LISP / AutoLISP :: Move Multiple Text To Line
May 31, 2012
I have some general knowledge in lisp coding. But I can't seem to figure this one out (even to get started). What I want to do is make a lisp that:
- selects a line
then
- select any amount of text (any type)
then
- moves all the text to that selected line without rotating the text
if a line is perfectly horizontal then move the text of the y axis.
if the line is vertical then move the text of the x axis.
or there can be a prompt asking the user to chose the angle or axis in which the text will move (say if they want to move the text to a slanted line, you can choose to move the text on an angle, while keeping the same format and not rotating the text, or you can ask the user if they want to move it only vertically or horizontally)
I would really like the code to integrate into my autocad.
See pictures
View 5 Replies
ADVERTISEMENT
Sep 12, 2012
We are using autocad 2012.
Is there a way to move all 3.5mm text to layer text3.5 and move all 5mm text to layer text5.
View 9 Replies
View Related
Jul 18, 2012
I'm trying to write a lisp routine to create a two line MLEADER but i can only get one line of text. Creating the MLEADER manually from the command line i just have to hit enter after the first line of text to add a second line. How would i do this in a lisp routine?
View 2 Replies
View Related
Oct 4, 2011
3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error. The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.
I’m playing round with a loop but how to achieve my need..He had a 3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error.
The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.
;Starting lisp program...(defun C:REDtext ();Creating Layers (if non existant)...(command "layer" "m" "TEKST-1.5mm" "lt" "continuous" "" "c" "1" "" "");Memorising previous layer...(setq MYOLDLAYER (getvar "clayer"));Setting requierd layer...(COMMAND "LAYER" "SET" "TEKST-1.5mm" "");Setting variable "MYHEIGHT" to "DIMSCALE" x 2...(setq myheight (* 2 (getvar "DIMSCALE" )));Requesting and storing usser defind point...(setq MYPOINT (getpoint "Start punt :")); Requesting and storing user defind text...(setq MYTEXT (getstring T "Nieuw tekst :"));Placing text...(command "text" MYPOINT MYHEIGHT "0" MYTEXT); Restoring previous layer...(setvar "clayer" MYOLDLAYER);Closing lisp program...)
View 1 Replies
View Related
Aug 1, 2013
this code is used to fix specific font but its problem that it will prompt you to select single text
i need to make it to select multiple text so it saves me a lot of time,
;;; Process Individual request
(defun cht_ProcessIndividual ()
(setq sslen (sslength sset))
(while (> sslen 0)
(setq temp (ssname sset (setq sslen (1- sslen))))
[Code]...
View 2 Replies
View Related
Nov 18, 2013
I have a custom command that I can initiate (c:TxtE). The function starts running but I need to begin adding several inputs at the command line following this. (ex: "4" "all" "" "oldtext" "newtext"). How do i do that within lisp once the custom command has already begun? If I need to modify the function how would i pass all these as optional type variables?
View 7 Replies
View Related
Oct 25, 2012
I am writing a program that allows the user to select hatched areas in a drawing and return the quantity, area, and the weight for the equivalent areas covered by tread plate.
My goal is to insert the data with text at a point of the user's choosing, so the end result is a text object in model space that looks like this:
Total Objects: 2
Total Tread Plate Area: 20.83 sq ft
.125 AL Tread Plate Weight: 40 lbs
.125 Steel Tread Plate Weight: 128.33 lbs
How to do is to have the text appear on multiple lines, instead of all across one line. Is there a way to mimic the enter key to enter the next line of text, just like when you use the text function in AutoCAD, instead of using multiple text commands and having to position each one using code.
(defun c:tread (/ cnt tot ss p sqft alwt stwt)
(vl-load-com)
(setq cnt 0
tot 0
[Code] .....
View 5 Replies
View Related
Sep 27, 2011
I have the following code which isnt quite working, it reads a text file which has a list of Names of images and their bottom left coordinates i.e. name x y etc. I want it to check for a name equal to that input then in this case alert the user it is found, eventually I want it to load the tile but for the moment where am I going wrong, also the lisp wont close the file and I dont know why.
(defun c:imi ()
(setq IM (getstring "
Input name of 2010 tile"))
(while (not (= "" IM))
(setq TILE (strcat "BM" IM))
[Code] ......
View 4 Replies
View Related
May 6, 2013
I am a beginner at LISP and this is a bit out of my league... and I'm trying to create a lisp where I can draw a polyline between 2 points that also places text with the actual distance offset above the line.
I did find this post and I'm not quite catching on.. [URL] ......
View 9 Replies
View Related
Sep 16, 2012
I need to be able to batch process a bunch of title block attributes automatically.
Block Name: Title Block
Tag Name: SH
Currently they come out with just the number 1, 2 , 3 etc I need to add a leading zero ie 01, 02, 03 etc
All the scripts I have will just replace the number with another
I just want to append the zero infront of the existing number
ie the code will need to read the existing number and decide if its less than 10. if it is less than 10, then the code just needs to append the leading 0. if its 10 or over, then do nothing.
View 4 Replies
View Related
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
Jun 6, 2012
I am trying to get a default value (from global variable) put as the default for getstring command. Problem is I want it as if I had typed it into the getstring command so I can modify it if required. It is for entering filenames which only change slightly ie 1129E09LS1 ...LS2 ...XS1 etc.
Current
(setq BlkName (getstring "
Enter Civil Cad File to Import: "))
For defaults that I don't want to change I usually use this format:
(or BlkName (setq BlkName (getstring "
Enter Civil Cad File to Import: ")))
View 9 Replies
View Related
Sep 16, 2002
I am trying to globally find and replace text in Autocad 2000 drawings. If I have a folder containing 10 Autocad files, I want to open every file in that folder, while in each file, search for a certain line of text and replace that text, then close that file, open the next and find/replace text in that file.
I've created an autolisp file that allows me to open all the files in a certain folder, but I can't find any way, either thru autolisp or scripts, to allow me to find and replace text in each autocad drawing without using Autocad's "find" command to manually enter the text when each drawing is open.
I want to setup the autolisp file to accept input up front, save the "old text" and "new text" to variables, then use those variables as the lisp routine is running.
This version was used to automate creating PDF files. The command 'PDF' is a command from another Lisp file.
View 9 Replies
View Related
Apr 23, 2012
I am trying to select multiple instances of text (dtext) with different strings but want to change all of the fomats to the same settngs. I have searched high and low on the web to no avail. I am using AutoCAD 2012.
For example: I want the routine to find all instances of "AA", "AB", "AC", "AD", "BA", "BB", "BC", "BD", etc... all the way up to "ZD".
Next I want all of those text entities to change to the following text formats:
Text Style = STANDARD_96Layer = F-ANNO-CKTText Justification = MIDDLE CENTERText Width = .8
Getting this to work with just finding one string at a time with the ssget function seems simple enough, but it's getting it to work with multiple strings that I can't get past.
View 8 Replies
View Related
Mar 29, 2013
I'm looking for a way to copy a text or a simple line, circle... ; after I copied it, the last entity change its color to green.
View 3 Replies
View Related
Oct 7, 2011
There are a ton of lisp to match text rotation to a selected line, but not vice versa.
View 9 Replies
View Related
Apr 23, 2013
I required a lisp for sorting Multiline text in alphabetic order. (Ascending and Descending)
For example in my drawing it contains lot of Mtexts having multi rows. I need to sort texts inside Mtext. Like PDC-012, DAG-012, AAG-096. I need that Mtext should be AAG-096,DAG-012,PDC-012.
View 9 Replies
View Related
Oct 3, 2011
I wrote a lisp program which creates a selection set using ssget. Then I use the bounding box commands to get the lowest point of that selection set. Now I want to move that selection set as a whole using the vla-move command. Can we vla-move a selection set?
View 8 Replies
View Related
Jan 22, 2013
I have a lot of drawings with two tables in them, and they are all over the place.
I'm able to change the columns widths using the following
(setq PipeList (vlax-ename->vla-object (car (entsel))))
(vla-setcolumnwidth PipeList 0 0.25)
(vla-setcolumnwidth PipeList 1 0.25)
(vla-setcolumnwidth PipeList 2 2.0)
(vla-setcolumnwidth PipeList 3 1.5)
(vla-setcolumnwidth PipeList 4 1.625)
(vla-setcolumnwidth PipeList 5 1.0)
(vla-setcolumnwidth PipeList 6 1.75)
I'm wondering if I could modify the assoc 10 value to a specific point of '(8.5 10.3675 0.0).
View 3 Replies
View Related
Oct 3, 2011
I wrote a lisp program which creates a selection set using ssget. Then I use the bounding box commands to get the lowest point of that selection set. Now I want to move that selection set as a whole using the vla-move command. I am having trouble doing this. Is this possible? Can we vla-move a selection set? Is there a workaround?
View 2 Replies
View Related
Jul 16, 2013
I am having nearly 1000 drawings where I need to change the title block in a new format.
I am stuck up in moving all the entities in cordinates 15,280 (upper point) and 205,55 (lower Point) to 275,294 (upper point and correspoing lower point.
View 7 Replies
View Related
Nov 23, 2012
I need a program to move some selected text to a line something like as extend command but for text objects!
suppose that there is a horizental line (y=constant) or vertical line (x=constant) and some selected text(or other objects), I want a lisp program that move these selected text (or objects) by their "insertion point" to this line.
in other word, if the selected base line is horizental (y=constant) then property of "Y" of all selected text should change to line's "Y"; and if selected base line is vertical (x=constant) then value of "X" of all selected text should match to line's "X" value.
for example, for base vertical line (x=constant) and 3 selected text(or can be any object) result is:
text1. | text1.|
text2. | ===> text2.|
text3. | text3.|
| .text1 |.text1
| .text2 ===> |.text2
| .text3 |.text3
View 9 Replies
View Related
Feb 7, 2012
I use the following code to assign a reactor to an object:
(setq marReactor (vlr-object-reactor (list (vlax-ename->vla-object oggmar)) "TEST" '( (:vlr-erased . reactor_upd) (:vlr-modified . reactor_upd) ) ))
"reactor_upd" is the name of the function that starts every change or delete the object.
I would like to exclude the command "MOVE", ie if I move the object, I do not want that part to the"reactor_upd" function.
View 2 Replies
View Related
Feb 3, 2012
I'm having an issue with using the SSGET to select a block so I can move it. I'm changing the UCS to be at the center of the top view in the program(user selects center) and the block is at 0,0,0 after changing the UCS. However when I use SSGET it doesn't select it. So I used:
(setq en(car (entsel "
Select a block :")))(setq enlist(entget en))
and it lists the DXF Code of 10 as
(10 15.0893 13.5165 0.0)
How can I then select it if I don't necessarily know where the block is going to be?
If needed: AutoCAD 2013 User using Visual LISP for editing LISP and DCL files Also I have AutoCAD 2011 currently still available for us, but we are using AutoCAD 2013 for 99.9% of AutoCAD use
View 2 Replies
View Related
Aug 7, 2013
Using Nentsel function, I can get info on a object that is nested with an Xref. Is there a way to move the selected object using ObjectDBX?
View 9 Replies
View Related
Jul 31, 2012
I found a program which rotates selected block(s) about thier insertion point. I modified it to rotate each of the block(s) about the y-axis. Works great. Now, I would like to change it so that it rotates a copy of each block about the y-axis and leaves the origial block in place. Its kind of like the mirror command exept it is rotating the new block(s) to the other side instead of flipping them. I want to keep all or the parameters of the block(s) the same as each original. I am using AutoCAD 2010. MOCORO is not recognized as a command. The new features workshop says to use the new command AMCOPYRM, which is not recognized either. Go figure.
(defun RotateDuplication (/ CN ENT theObjects SS)
(vl-load-com)
(setq SS (ssget (list (cons 0 "INSERT"))))
(repeat (setq CN (sslength SS))
(setq CN (1- CN)
ENT (ssname SS CN)
[Code] ......
View 1 Replies
View Related
Jul 9, 2013
I have code that will set and sae a current UCS to the front of an entity, of course, depending on the viewpoint. This is so, because we need all draft lines in front of 3D solids, such as dimensions, leaders for labels, text entities and so on (the reason for not putting these entities in paper space is another discussion ).
But I'll have on of two problems on numerous occasions:
1. The user forgets all together to run the command.
2. The user will pick the wrong entity that is in the foremost position in that view.
The code I have utilizes the following:
(setq ent (car (entsel)))
(vl-load-com)
(setq obj (vlax-ename->vla-object ent))
(vla-getboundingbox obj 'LowerCorner 'UpperCorner)
(setq LowerC (vlax-safearray->list LowerCorner))
(setq UpperC (vlax-safearray->list UpperCorner))
Then I'll analyze the X, Y and Z of both the lower and upper corners, and set my UCS to whatever is proper.
Is there a "LowerCorner" and an "UpperCorner" for all entities. I can't see "VSMIN" and VSMAX" working because the elevation of the returned coordinates is always "0,0"
View 4 Replies
View Related
Dec 22, 2012
I have a slightly unusual query that I can't seem to find a solution for elsewhere. I have an existing OS plan that is 'off grid', and would like to adjust the vertices at the ends of all the existing lines and polylines so that they all sit on a grid point, ie round all vertices to the nearest whole number. Is there a quick command or script that does this?
View 2 Replies
View Related
Mar 20, 2012
If there any lisp for the below sequence:-
1) select a few group of pre-set block name
2) change all these pre-set bloack name to a layer " Eye Bolt"
At moment, i have several kind of block such as example of "EB10", "TEB10","EB8","TEB8" and etc.
View 9 Replies
View Related
May 24, 2012
I'm dabbling in lisp to reduce some drafting time. I'm looking for a way to move a named block left 5 inches. The names block in this instance is "Bricks". What would be the easiest way of writing this in lisp form? I searched through the forums and I couldn't find what I was looking for. This is not after an insert command. This is a block that currently exists in the drawing template.
View 9 Replies
View Related
May 24, 2002
Any lisp routine where you can select objects and do a global rotate, scale, etc. from each object's insertion point ?
View 9 Replies
View Related