AutoCAD Visual LISP / AutoLISP :: Get Z Value From Text
May 10, 2012
I have text objects with the same Z value and I will select as follows:
(setq sstxt (ssget '((0 . "TEXT")(8 . "APS-text"))))
How to store this value in another variable "zvalue" to apply to:
(command "change" "select text objects" "" "_p" "_e" zvalue "") ?
View 9 Replies
ADVERTISEMENT
Jun 21, 2012
I have two attributes "REVN" and "REVD" in a block "ATT" that I would like to change (globally preferably) to the following.
(1) Existing text to keyboard entry text.
(2) Colour from existing to 10
I am a bit lost in the (command "-attdef" .......)
(defun c:atc ()
(setq rev (getstring "Please enter review"))
(setq dat (getstring "please enter date"))
(command "-attdef" .."ATT".."REVN"....."c" "10")..)
(command "-attdef" .."ATT".."REVD"....."c" "10")..)
)
View 4 Replies
View Related
Oct 8, 2013
When I click on an object to retrieve it's extended data, the data keeps writing to the right, it does not return to the next line, when the text approaches the end of the screen. Very difficult to analyze information.
View 4 Replies
View Related
Mar 2, 2013
I want to know is there any formula/calculation for the width of text object before creation/insertion? At now I used approximated width size via a simple .
(Defun GetStrWidth (str H W) (fix (*(* H W) (strlen str))));;usage: (GetStrWidth "This is a Text." 2.5 0.8);;H: TextHeight; W: width factor.
I know that for the existed text in drawing I can use textbox command, but for the texts that has not been created, what can I do? Is there any formula/calculation depends on font name, text height and width factor?
View 9 Replies
View Related
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
Oct 25, 2012
A program that prompts:"select objects:" then I can select some objects like as text, line, circle,... after that program find all texts in selected items and swap text
swap means: xxx/yyy ===> yyy/xxx ; "/" is a divisor
swap function for one text is here:
(defun c:swap ( / pos ent el txt)
(vl-load-com)
(if(null #div#)(setq #div# "/"))
(setq #div#
(if(=(setq tmp(getstring(strcat "
Divisor character: <"#div#"> ")))"")
#div# tmp
)
[Code]....
but I want a program to prompt me like this:
(prompt "Select objects:")(terpri)
(setq a (ssget '((0 . "TEXT"))))
and gets divisor char </>:
after that:
(setq n (sslength a))
(repeat n
....
)
repeats n times, n=number of texts in my selection
View 6 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
Aug 4, 2013
I have inside every text,Mtext contents different text style like Arial_1 , Arial_2.
How i can give all the contents inside one style ? the normal procedure i will enter inside text to enter editing mode and changing text format style one by one. I want it once.
I want to save my routing of entering every text to change its content text style.
(Notice:select all from outside without editing mode will not do the job)
View 2 Replies
View Related
Jan 13, 2012
I use the bounding box (vla-getboundingbox) to assess parameters of blocks. These blocks have text on some of the faces that extends beyond the simple dimensions of the blocks themselves. I'm wanting to have bounding box ignore the text and can't sort it out. I've tried putting the text on a separate layer and turning it off and freezing it.
I've considered looking at sub entities and filtering out the text but I don't know if there is a solution here or not.
View 5 Replies
View Related
Aug 29, 2012
I have an mdb database, with one table called MATRIX. That table has seven relevant fields, see attachment. What I want to have is for every language an txt file.
Like for example:
DUT.txt
2BK1;BATTERIJKAST sBk
2RK1;REMKAST sBk
and so on
ENG.txt
2BK1;BATTERY CUBICLE sBk
2RK1;BRAKE CUBICLE sBk
and so on
ITA.txt, the same
DEU.txt, the same
ESP.txt, the same
FRA.txt, the same
View 2 Replies
View Related
Jul 24, 2013
This is a routine that draws a line between duplicate text.
Would it be possible to have the line as bold red p-line so that its easier to identify.
;; This AutoLISP routine examines all the user-selected TEXT and MTEXT items,
;; and draws a line on the current layer between any two that have identical
;; string values.
;; Leading and trailing blanks spaces are ignored.
;; %% modifiers, like %%u, are not ignored.
;; Upper- and lower-case differences are not ignored.
(defun c:fdt () ;;Find Duplicate Text
(prompt "Select text items to examine: ")
(setq ss (ssget '((-4 . "<OR") (0 . "TEXT") (0 . "MTEXT") (-4 . "OR>"))))
(setq n 0)
[Code]....
View 9 Replies
View Related
Oct 7, 2013
I've looked around several places for a LISP that will alphabetize existing text. I cant seem to find what I need. I am looking for a routine where I can manually select text in a given order to get the outcome of AA,AB,AC,AD, or BA,BB,BC., etc.
I've attached a drawing to better explain what I am looking for. I do not know how to write LISP routines, but I know a little to be able to modify an existing one.
View 4 Replies
View Related
Nov 27, 2011
I'm trying to create a leader with no attachments. Code below. But I can't seem to shut of the Annotation Dialog.
(setvar "cmddia" 0)
(vl-cmdf ".Qleader" "S" "A" "N" pt1 pt2 "" )
Also I am trying to create a leader with text that is aligned and above the leader line.
View 6 Replies
View Related
Aug 16, 2011
I have encounter some text exploding problem. As shown in attachment, I would like to know if there any possible way I can explode the text into polyline or single line and maintain it within the position and style?
View 8 Replies
View Related
Apr 29, 2013
I run into some issues where i need to change an attribute based on where a block is located on a drawing. I started this routine to select the block, and then select the text that I want to change the block attribute to. It seems like everything is working up until this point. What I want to do is then replace the first selected with the second selection. How would I go about doing that? here's my code so far:
(defun C:uf ()
(if (setq fuse (nentsel "
Select Fuse Attribute: "))
(progn
(setq en (car fuse))
(setq enlist (entget en))
(setq fuseatt(cdr (assoc 1 enlist)) ) ) )
(if (setq mt(car (entsel "
Select Text: ")))
(progn
(setq enlist2 (entget mt))
(cdr (assoc 1 enlist2))
(setq wiren(cdr (assoc 1 enlist2)) ) ) )
)
View 8 Replies
View Related
May 6, 2009
The PARTS LISTS on our old drawings are simply text entities and lines. Some are MTEXT. But our new drawing template has us creating our parts list using the actual AutoCAD TABLES entity.
I'm looking for the best method to go from lines and text in AutoCAD, to an AutoCAD table. As of now, I have to retype everything since I can't select a column/row or group of text entities, copy/paste into a table.
Any LISP function that will allow me to go from TEXT and LINES to a TABLE? I've tried B2E (lisp name) but it's not working - found that on a lisp site somewhere.
View 9 Replies
View Related
Nov 29, 2012
I cannot purge a textstyle out of my drawing. When I run purge nothing is available.
However if I select the style from the style dialog I am able to select delete and delete the style.
When I use the method on the style (vlax-invoke-method style 'Delete). AutoCAD states:
Automation Error. Object is referenced by other object(s)
The style is defenatly not in use but may have been used in the past.
View 8 Replies
View Related
Oct 15, 2012
I want to override the measurement in a dimension with a string of text using a LISP command.
E.g.. "select dimension"
type new text for dimension
replace dimension measurement with new text. I can get the entity and its values, buy not sure which value to change for the "text override".
BTW Acad 2012.
View 3 Replies
View Related
Nov 8, 2012
How to do a default text for getstring? I would use initget in the following except the prefix can be any letter(s). And the problem with what I have below is it does not type the default text if nothing is entered.
(defun C:ww ()
(if tmp (= nil) (setq tmp "ABC"))
(prompt "
Enter prefix <")(princ tmp)(princ ">: ")
(setq pfix (strcase (getstring)))
(if (= pfix nil) (setq pfix tmp))
(setq tmp pfix)
(setq PT (getpoint "
Pick point: "))
(command "TEXT" "S" "Standard" "J" "M" PT "6" "0" pfix)
)
View 9 Replies
View Related
Oct 7, 2011
Any lisp routine out there to append (prefix) text to dtext?
i have 100s of dtext that has numbers in them, and i need to place the "#" symbol in front of them now.
View 3 Replies
View Related
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
Jun 24, 2012
I have a block "MANAGER" with Two Attributes "CETOP" and "CEBOT" I would like a lisp to replace what ever is in those attributes with defined text, for my purposes "Text1" and "Text2". I would like a simple routine that even I can understand so I can apply it to a couple of other lisp projects I have.
View 6 Replies
View Related
Apr 29, 2012
how to draw a text entity in 3d, where I know the 3d ins point, and the plane it should be flat to.
I have not drawn text or inserted blocks programatically before where the plane they lie on is not flat.
I have done it before by setting a ucs and drawing stuff, but now I want no switches of UCS involved.
[URL]
View 2 Replies
View Related
Apr 13, 2012
I would like to know how i can create a linestyle with text using lisp?
View 1 Replies
View Related
Nov 14, 2012
I need a LISP program that prompts: "select text(s)" then I select for example 100 text in open drawing file.
after that this program creat a file (LIST.CSV) and write each selected text in line by line of this file:
result text file (LIST.CSV ) should be:
Text1
Text2
Text3
...
...
Text99
Text100
ofcourse Text1 is the content of a text object.
View 9 Replies
View Related
Dec 16, 2013
I am trying to put together a LISP that changes the font of two text styles. One bing named "Standard", and the other "WD".
This is what I have so far...
(defun C:CHANGESTYLE (/ entities len count ent ent_data ent_name new_style_name)
(command "STYLE" "Standard" "Romantic" "" "" "" "" "")
(setq entities (ssget "X" '((0 . "TEXT")))
len(sslength entities) count 0);
[Code]....
I couldn't figure out how to select mtext and text all in one swoop, so i ran it twice
Now, when i run this code, i get the following error "lselsetp nil".
CADMASTER TECHNOLOGIES, LLC
[URL]....
View 3 Replies
View Related
Aug 1, 2006
What is the Command that Converts a Field to Text so that I can stop a Field updating after the initial set-up? I need to apply this in lisp.
View 9 Replies
View Related
May 24, 2007
What would be the ideal way to find out the overlapping text.
View 9 Replies
View Related
Dec 30, 2013
I need to remove or replace text after comma in certain comment such as "Rope, approx. 0.3m length" i want to remove the red part
I've another LISP that only remove a fixed length which is not the case i've now.
View 9 Replies
View Related
Jun 14, 2009
how create lisp convert text (from drawing) to excel
View 6 Replies
View Related