AutoCAD Visual LISP / AutoLISP :: Using TEXT Not MTEXT To Create Multiple Lines Of Text?

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


ADVERTISEMENT

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 :: 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 :: 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 :: 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 :: Select Multiple Text To Heal Instead Of Single Text?

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

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 :: 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 :: 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 :: Go From TEXT And LINES To TABLE?

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

AutoCAD Visual LISP / AutoLISP :: Write Several Lines Of Text To TXT File?

Apr 13, 2012

I know how to write a single line of text to a txt file with LISP, but how do i write two or more lines of text to a txt file ussing lisp?

View 4 Replies View Related

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 View Related

AutoCAD Visual LISP / AutoLISP :: Placing Multi Lines Of Text In DCL Edit_box

Jan 10, 2012

Is it possible to have Multi lines of text in a .dcl edit_box or such? 

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Edit Attribute Text In Multiple Drawings

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

AutoCAD Visual LISP / AutoLISP :: Create Linestyle With Text?

Apr 13, 2012

I would like to know how i can create a linestyle with text using lisp?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Put Multi-lines Of Text Into Drawing Info Comments

Dec 19, 2011

I am able to insert multi line text into the Drawing Properties Summaryinfo standard field "comments" by using  string concatenation in VBA by using "mytext" & vbLF & vbCR "mytext".

But I can't find a way that works in autolisp. This code does not work.
 
(defun c:FillComments (/) (vl-load-com) (setq acadObj (vlax-get-acad-object)) (setq acDoc (vlax-get-property acadObj 'ActiveDocument)) (setq acDocSumInfo (vlax-get-property acDoc 'SummaryInfo)) (setq *customer* "MyCustomerName") (setq *location* "MyLocation") (setq *project* "MyProject") (setq*comments* (strcat *customer* ", " (chr 10) (chr 13) *location* ", " (chr 10) (chr 13) *project* ) ;_ end of strcat ) ;_ end of setq (vlax-put-property acDocSumInfo "Comments" *comments*) (princ)) ;_ end of defun
 
The text comes in but all on one line.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Globally Find / Replace Text Across Multiple Drawings

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

AutoCAD Visual LISP / AutoLISP :: Select Multiple Instances Of Text (dtext) With Different Strings

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

AutoCAD Visual LISP / AutoLISP :: Create A Line With Text Offset

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

AutoCAD Visual LISP / AutoLISP :: Create A Selection Set Of Y Values Of Text?

May 9, 2013

What I am trying to do is create a selection set of the "y" values of text.  I've started by pulling out all the text on the drawing, but I need it to continue to grab only the "y" values of the text on the drawing.

(setq alltext (ssget "_x"  (list '(0 . "TEXT")) 
)  
)     

I've tried a bunch of different things but I am still new to lisp.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Text Based On Room Dimensions?

Dec 19, 2012

make a LISP that will work with my room dimensioning? I'd like to be able to specify the width and depth of the room using a command similar to the "dist" command, and then click a point to place a text based on the distances gathered. I'd also like the text to be formated into architectural units and displayed like this: 12'-0" X 13'-5". Also, if possible, round the result to the nearest inch (to avoid 1/2" and 1/4" dimensions).

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Larger Routine To Create And Rotate Text Based On Object Selected

Dec 29, 2011

the expression in question is part of larger lisp routine to create and rotate text based on the object selected and the viewtwist variable (we use dview twist to rotate our views when needed)

So the expression in question:
(< (/ pi 2) ang (* pi 1.5)
where ang is the total angle used to determine proper rotation of the text.

Now the problem. In most cases where ang = 90 (or 1.5708 radians) this works fine. the two exceptions i have encountered

in testing are a line at 70 degress, viewtwist 20, and line at 50, viewtwist 40. For whatever reason at these two conditions the expressoin evaulates True instead of nil and rotates the entire text object incorrectly (180 degrees). So question is how exactly is this being evaluated? i know its comparing ang (* pi 1.5) to (/ pi 2). is there some sort of rounding error? or maybe the expression needs a wee bit more definition? attached image and full lisp routine for reference of what is happening, blue text is angle of the line as created by routine at viewtwist 0.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Multiple Mirroring Lines

Aug 27, 2013

Project involves repeatedly mirroring a line by selecting mutiple lines to do the mirroring. Probably sounds confusing.

The progress so far can be found here: [URL] ........

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Join Multiple Lines Together?

Aug 3, 2013

I want to join multiple lines together like join command but with multi selection.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Divide Multiple Lines

Apr 25, 2013

I need to divide thousands of lines into half, but AutoCAD divide command can only allow you to select one line at a time.Is there any way we can divide multiple lines  at once.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Existing Text To Keyboard Entry Text

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

AutoCAD Visual LISP / AutoLISP :: Text Won't Wrap In Text Window?

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

AutoCAD Visual LISP / AutoLISP :: Text Width Before Text Creation

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







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