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


ADVERTISEMENT

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 :: 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 :: Creating Menus In Command Prompt?

Nov 22, 2011

I am able in lisp to create a command prompt selection menu, easy (see code below).However what I want is for the lisp to be ready to undertake an action UNLESS I select an option.

An example is the offset command wich has a function ready to roll (namely the specify offset distance) "OR" I can interrupt the "specify offset distance" and enter one of the sub options (in the case of offset Through/ Erase/Layer).

My code attempts to offset also, UNLESS the user wishes to specify a distance.
 
(DEFUN C:loadoffset ();CREATING MENU FOR SUB COMMANDS [GETIT] [GOTIT]...(setq choose (getstring "
Select an option... [1=GET DIST] [2=GOTDIST]: "))(if (or (equal choose "1"))(GETIT))(if (or (equal choose "2"))(GOTIT));TERMINATING SELECTION MENU...)(defun getit ( gotit )(setq MYDIST (getdist "
SELECT A DISTANCE: "))(gotit))(defun gotit ()(command "_offset" MYDIST pause pause"exit"))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Change Command Prompt Directory

Aug 17, 2011

When you use shell command and type cmd, command prompt appears and the default location is My Documents. How can i change it to another directory by using only lisp?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Loop File Names In Command Prompt?

Dec 6, 2012

I have a parent directory with x-amount of folders contained inside. I say X-amount because I would like to keep adding or deleting folders as time progresses. I want the folders contained within this parent directory do be read into a lisp variable and then be printed to the command prompt till every folder is displayed by name, then the loop may stop.

View 5 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 :: Changing Text Style Used By Table Style

Jun 29, 2012

I am looking for a way to change the text style used by a table style with Visual LISP.  So far I have been able to get the IAcadTableStyle object from the acad_tablestyle dictionary, but there is no property for text style.  Is this even possible?  Code and results are below.

(defun DumpTableStyles ()
(setq dict (vla-get-dictionaries (vla-get-activedocument(vlax-get-acad-object))))
(setq TableStyles (vla-item dict "acad_tablestyle"))
(vlax-for TableStyle TableStyles
(vlax-dump-object TableStyle)
)
)

[Code]....

View 3 Replies View Related

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 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 :: 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 :: How To Modify Dim Text Color In Current Dimstyle

Jun 27, 2012

How to change the dim text color in current dimstyle with a lisp routine? I want to modify current dimstyle instead of override current dimstyle, so it can change all existing dim text color under the current dimstyle.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Retrieving Current Paper Text Height

Oct 10, 2012

I'm looking for code to retrieve the "Paper Text Height" from the current (active) "Text Style".

View 7 Replies View Related

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 :: 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 :: 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 :: Current View Align With Current Ucs?

Jul 20, 2013

how can i know if the current view/display is align with the current ucs?

let's say i have rotate the ucs about z axis 45 degrees and make it plan now i draw some things and then i change back to world

worlducs = 1

viewdir = 0,0,1

ucsxdir = 1,0,0

ucsydir = 0,1,0

but the display is still in the ucs z 45 (ucsfollow = 0) set the view to PLAN current (now the view is aligned) but the system vars does not change.

For a plan UCS, you would need to compare the VIEWDIR system variable and the cross product of the UCSXDIR and UCSYDIR system varaibles.

[URL]

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check Current Plotter Name For Current Tab

Sep 3, 2013

Technique that can check the current plotter name for the current tab and assign it to a variable?  i.e. can it be assigned to a variable to check if if equals "myplotter1".  The next step  - is there a technique to change the plotter name to "myplotter2.pc3".

I have partially done the latter part of this in the past using the -plot command line to ASSIGN a  new plotter but I would really like to only run the routine if it really needs to.  

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Delete Text Style Not In Use?

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

AutoCAD Visual LISP / AutoLISP :: Change Text Style

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

AutoCAD Visual LISP / AutoLISP :: Changing Text Formatting Style Inside All Text Contents

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

AutoCAD Visual LISP / AutoLISP :: How To Restore Previous Text Style

Jun 5, 2012

I wrote (setq oldtext (getvar "textstyle")) to save the current text style,

(setvar "textstyle" (getvar "dimtxsty")) to change the text style to the current dimension text style (which appens to be romans) and later (setvar "textstyle" oldtext) to restore the text style to its original setting but it won't work.

This is the same format used to save and restore osnap in many lisp routines.

When I check the program in the visual lisp editor, oldtext returns "standard" (the original text style - so that part works) but "textstyle" returns nil.  I even tried (setvar "textstyle" "standard") to no avail.  "Textstyle" remains romans.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Add Text To Command Line

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

AutoCAD Visual LISP / AutoLISP :: While Loop With Prompt

Nov 19, 2013

I am trying to put together a loop to enter a number greater than the previous number entered. Below is my mockup and I just cannot get it.

(defun c:22 () (while (setq d (getreal "
Specify diameter: ")) (setq $d d) (while (if (<= d $d) (progn (prompt "
Specify greater diameter.") (setq d (getreal "
Specify diameter: ")) ) ) ) (setq p1 (getpoint "
Specify point: ")) (command "CIRCLE" p1 d) ))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Losing Text Style When Use Entmod On An Attribute

Feb 25, 2013

I have a lisp function that is updating attribute values on a newly inserted block. The lisp function uses entget to read the attribute. Then it plugs a new value into the assoc 1 using subst, then uses entmod to update the attribute's value. It all works fine except that the attribute loses its style, i.e. assoc 7, somehow. If I do an entget on the attribute right after the entmod the assoc 7 is nil. The symptom on the drawing is that the attribute value is not visible until I close and open the drawing.

This only happens on a newly inserted block on existing drawings. If I close the drawing and reopen it then the lisp function works fine. Or If I insert the same block on a new drawing it all works fine. what would cause the assoc 7 to go missing after an entmod to change the attribute value?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Font Style Of 1 Text Item?

Sep 9, 2010

im my current coding project im attempting to change the font stlye of 1 text item

i tried used the simple method of

[code]

(command "STYLE" "simplex" "ARIAL" "" "" "" "" "")

[/code]

however, using this changes the text's font in the whole drawing

i searched the forums here and everything i found either didnt work or changed all the text.

is there a more elegant way of doing this with just a selected text item and not the text in the whole drawing?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Suppress Igesout Dialog Box?

Feb 13, 2013

how to suppress the igesout dialog box?

I would like to supply the command inputs via autolisp i.e. (command "igesout" .... etc.

but can not seem to get the dialog to NOT appear.

-igesout does not work either....

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Put Default Text On Command Line For Getstring

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

AutoCAD Visual LISP / AutoLISP :: Export TIME Command Results To Text File

Oct 22, 2011

Run TIME command and then take the resulting text and save it to a file.

Ideally, the text file should be named based on the drawing name. I know there's ways to write text to a file but I haven't had any luck taking the output of a command and exporting it.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: List Command Dumping To Text File Locally

Oct 31, 2013

Need a lisp that could dump the values of a list command in a text file placed in a folder C:user121list.txt.

View 9 Replies View Related







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