AutoCAD 2010 :: Replacing Part Of A Text String?
Mar 27, 2012
I am trying to add text to a set of text strings in a drawing.
The tricky part is that not all of the text strings are the same.
For example, change part numbers
123, 125, 456, 892
to
123-70, 125-70, 456-70, 892-70
Is there a way to do this for all of the strings at once?
View 9 Replies
ADVERTISEMENT
Jun 15, 2012
I was writing code for my custom .net extension dll and one of the procedure involved therein was to replace the Text of MTEXT and DBTEXT entities with some predetermined Text String. I am using C#, AutoCAD 2012, and Visual Studio 2010. Here is the part of code wherein I am trying to replace the Text String of the MTEXT or DBTEXT entities.
foreach (SelectedObject selectedObject in selectionSet) { Entity currentEntity = transaction.GetObject(selectedObject.ObjectId, OpenMode.ForWrite, false) as Entity; if (currentEntity == null) { continue; } if (currentEntity.GetType() == typeof(MText)) { ((MText)currentEntity).Contents = textToCopy; } else { ((DBText)currentEntity).TextString = textToCopy; } } transaction.Commit();
The issue is that the text of the MTEXT or DBTEXT is not getting replaced with the string I am trying to. I debugged the code and it correctly hits the setting of MText.Contents == "Some String" and also transaction.commit(). But the text of the MTEXT still remains to the old value. Is this the correct way of changing the text of MTEXT / DBTEXT through the .Net API.
View 3 Replies
View Related
Aug 20, 2011
is there any solution to change a special character font in paragraph.
I'm formatting a book in corel and want to change all the question marks (?) in a different font while retaining other characters in same fonts. Is there any possibility in corel? I've searched on internet but there is nothing useful.
View 1 Replies
View Related
Jul 19, 2012
Is there a way when finding and replacing a text string to style the block of copy. My problem is that I have some color codes given by the customer that now need to be converted to our internal color matches on our production drawings.
The original string of text looks like this:
Holder: P1 (Metallic Silver)
What I’m getting when I go to replace this string is:
Holder: Natural Satin
What I want is:
Holder: Natural Satin
I do not want the replaced text to be italicized. I'm thinking since the original string ends with an italic style that the replacement string is also italicized. There are about 50 pages of drawings with about 10 colors on the job and some pages have them entered in more than one place. So that's a minimum of 500 entries and defititely more considereing the multiple places these are called out. I'd really rather not have to copy and paste all of these by hand. I'm use to FreeHand, which would respect the font styling of pasted text in the find and replace diaglog.
View 6 Replies
View Related
Jan 12, 2011
I was wondering if there is a way that AutoCad can edit one text string and the same change can affect another text string, instead of editing the same thing twice.
View 9 Replies
View Related
May 2, 2012
I have spent the last three days writing a lisp program that will copy a text string from one text file and paste it into another. I have tried using the write-string, get string, prin1, princ and print functions with no success.
View 2 Replies
View Related
Feb 18, 2013
I write a code to replace strings in one string.for example
str="AutoDesk, AutoCAD, 2013, Electrical, 64Bit"
patt=", "
NewStr=" - "
==> result: "AutoDesk - AutoCAD - 2013 - Electrical - 64Bit"
;;replaces NewStr instead of Patt(s) in Str string(defun ReplaceStr (NewStr Patt Str)(While (> (vl-string-search ptt str) 0)(setq Str (vl-string-subst NewStr patt Str)) );;whilestr) ; usage;(ReplaceStr " - " ", " "AutoDesk, AutoCAD, 2013, Electrical, 64Bit")
==> result= ; error: bad argument type: (or stringp symbolp): nil
View 9 Replies
View Related
Sep 5, 2012
I have text with number string. ( eg: weight 50 kg, xyz weight 362 kg)i want to extract the number values of "50" & "362" from the text string.
View 9 Replies
View Related
Nov 16, 2012
i failed to find one which would change string of a text to other for all types of objects. I mean it was usually either only multitext, or only text, dimensions or attributes.creating one which would change in abt 200 drawings:
-001
-002
-003
to:
-00001
-00002
-00003
in attributes, text, multittext, leaders, multileaders, dimensions..... at the same moment?
It is meant to be used in ScriptPro (by loading lisp in script).
If not possible, then can also open each file and run the lisp in each of them - still would save lot of time.
View 4 Replies
View Related
Oct 3, 2011
I've been looking for a solution to remove the unit string ie Lbs, g, kg from the value given from a 'Mass' value in a text string.
As you may all know, creating text and having a 'physical property - mass' value...the unit string is there...
Lots of people on here have the problem...no-one has got a solution.
Until now...
Basically...open the part you need to get the mass property of in your text string.
Follow the instructions on this webpage...this is the first part...
[URL]
Basically, this creates a Mass property value in the parameters table that you can call on as a text parameter.
It's similar to the custom iproperty model - mass but NOT the same.
Once you have done this, you can go to the drawing of the part and create a text string in the drawing and call it up as shown in this procedure. BUT it still has the unit string.
Here's the best bit that you want to know...
To get RID of the unit string...open up the part again from the drawing...click on the parameter icon...find the user parameter...in the Nominal value column, right click on the value and you get a pop-up that gives you 3 options...
Custom Property Format, Make Multi Value & Delete Parameter.
Click on Custom Property Format.
The pop-up window comes up...showing you the property type...in my case...the 4 left columns read Text, g (grams), Format & Precision...
On the right hand side I have a Preview of the text...then 3 check boxes...Units string, Leading Zero's, Trailing Zero's.
Units string is checked.
Uncheck it.
Close it...Save your part...go back to the drawing and hey presto!...the text now shows the weight you require as a straight value...no units!
View 9 Replies
View Related
Jul 26, 2012
I would like to create string that would be tied to a rod and wrapped around an axle. Then when the rod is moved the string rotates the axle, but the string continues to grow as it is being pulled.
View 2 Replies
View Related
Jun 26, 2012
What I want to do is have text edit for single line text to start at the end of a string of text instead of high lighting the entire text. Is it possible to do this?
View 4 Replies
View Related
Nov 25, 2012
if I cut a part of an image out, and want to replace with another image, is there any way to know the correct size (in pixels) to make it match the deleted image portion?
I tried Properties but it gave me the dimensions for the entire image.
And I have no copy of the deleted portion to check its size because I enlarged it when I placed it originally in the entire image and didn't save it separately.
View 11 Replies
View Related
Sep 28, 2012
Instead of adding text as a prefix or suffix i would like to know if it is possible aswell to remove text from within text: For example:
I have these texts "I am not good", "he is not good", "what not to be" And i would like to remove the word "not" from all selected text so i would get "i am good", "he is good" , "what to be". The set word not will always be the same, so there is no need for user string input.
View 6 Replies
View Related
Dec 17, 2013
What is the best way to replace an old titleblock with a new titleblock? I am using AutoCAD 2010
View 5 Replies
View Related
Aug 28, 2011
replaced the head on the attached photo and would like to use this for an employee presentation. How I can make it look a little more real? The employees are going to know that it was photoshopped, but still would like to make it better if possible. I still feel the head is a little too bright.
View 5 Replies
View Related
Nov 14, 2013
I have a list ("temp.dwg" "temp2.dwg") and would like to add the string "insert text here" into each item in the list resulting in ("insert text heretemp.dwg" "insert textheretemp2.dwg"). how would i go about doing that using LISP?
View 2 Replies
View Related
Jan 2, 2014
I was asked if there was a way to replace an embedded (Nested) block inside of multiple blocks, with another block. I thought of Express Tool's "Replace Block with Another Block", that that only works with blocks inside the drawing, not nested blocks. The only other way I know of is to redefine the block current block, then rename it to the new name.
View 6 Replies
View Related
Sep 4, 2013
I change a block's attributes programmatically using thisfunction I created:
private void UpdateAttributes(Database database, Detail det) { using (Transaction tr = database.TransactionManager.StartTransaction()) { //Grab the BlockReference the detail refers to. BlockReference block = (BlockReference)tr.GetObject(det.ObjectId, OpenMode.ForRead); //Iterate over the Attribute ids. foreach (ObjectId [code].......
You can ignore the Detail and Detail Attribute objects as they are also user-defined. Also note that this function expects the database to be currently open for working on.
Everything in this function works fine, but there is a strange quirk that becomes noticeable only when I use this function to edit an attribute that has its "Invisible" property set to "No".
Below, is the original block that is edited via this function:
As you can see, the block has a number with 4 digits (for our purposes, call this the Block Number).
View 6 Replies
View Related
Aug 16, 2012
In a drawing, i have several text strings, 's', that i would like to change to a known block... is this able to be done? there are over 3000 's' in the drawing, hoping to change them all to the same block. let me know if this can be done.
View 2 Replies
View Related
Aug 16, 2012
in a drawing, i have several text strings, 's', that i would like to change to a known block... is this able to be done? there are over 3000 's' in the drawing, hoping to change them all to the same block.
View 9 Replies
View Related
Aug 15, 2011
I know it is easy to enter special characters in using “%%” escape sequence. However, if I am not entering in single or multiline text, but rather in a dimension annotation’s “override” field, I found that the newly entered text completely overrides the original dimensional annotation.
For example, if originally I had a diameter of 7.98, and I would like to put a Φ sign in front of it to make Φ7.98, but it seems that there is no way to preserve the original content of 7.98 together with the Φ sign.
Is it possible to keep the original measurement within the string? What is the special character representing the original measurement?
View 5 Replies
View Related
Dec 18, 2009
I want to have a string of text that is curved at a given radius.
View 9 Replies
View Related
Dec 20, 2011
I have a custom iProperty with a text value of "Plate, Steel 140 mm". Is it possible to strip out the 140 (text) from the string and convert it to a number?
View 7 Replies
View Related
Dec 12, 2012
I don;t know what happen with this piece of code, I have checked it a million of times and seems to be well done. I'm trying to filter a previous selection and select Text or Mtext objects that are in the layer COTREF, and that contain the strings "%%c" AND "L" at the same time. The problem is that the code it's not selecting objects with the "L" included.
Here's the
(setq grupo1 (ssget "" '((0 . "TEXT,MTEXT")(8 . "COTREF")(-4 . "<AND")(1 . "*%%c*")(1 . "*L*")(-4 . "AND>"))))
The most unreasonable thing it's that I have 2 text objects exactly the same and when using this filter codes just one object it's selected (cyan cloud), check included DWG file.
I'v been searching about it and seems some persons are having problems with ssget filters in the newer versions of AutoCAD, I'm using 2012. I'm also suspecting for the character "%" which could be working as a wild-card, but as far as I know it is not.
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
May 28, 2012
In a layout for an ebook I have some important black and white bitmap illustrations in tiff., 300 dpi. These have appeared ok on print, but on screen, reading the same pdf-file, they're unacceptable, especially some texts in fontsize 5-6 pt are unclear. I have to convert the drawings, or at least the texts, to vector graphics. Can I open these tiff.s in Photoshop, change only the texts to vector graphics and then save in a format, that can be inserted in the Word2010 layout?
View 2 Replies
View Related
Jun 10, 2011
I have to replace text in a banner image with different text. Maybe if I upload the banner, it would be more useful...
I have to replace "Customer Satisfaction" with some other text. The text is embedded in the image; so, it's not that easy, at least for me, to replace it without making it look amateurish. Of course, I duplicated the background and worked on that layer.
First method I tried was using the clone stamp, zooming in to 1600% to painstakingly erase it. But then when I zoom out, the background where the text was placed over does not match its surroundings and looks like someone shaded it. If you zoom in real close, before making any changes to it, you'll see that the "green" (what the RGB is) touching the text is different than the "green" in areas not touching text.
Next, I thought of using the magic wand to select the text for me and that looked liked it worked. But the problem is once I select it, how to delete it or blend it in with the background. That is, if I select the "C" in "Customer Satisfaction" with the magic wand, for instance, pressing delete does nothing. Then I found I can fill the area, after I select it with the magic wand; however, what the RGB combination is of the background. Is there a way I can find out what the RGB value is of the background, then apply that to my fill color and effectively delete the "Customer Satisfaction" text?
Once I'm able to get rid of the text, I can use the text editor plugin tool I downloaded to replace the text.
That's my logic, anyway. How I can replace text in an image, preferably as neatly as possible.
View 6 Replies
View Related
Aug 29, 2011
I have an autocad drawing with so many light fixtures with all different names.Now we have to change all those names, i already have an excel sheet containing two columns with first one containing "name in drawing" and second one containing respective "new name".
Is there any way to replace the names in cad file using that excel sheet.i just dont want to do all those thousand rename manually ...
View 6 Replies
View Related
Dec 14, 2006
Make new text on button replacing old text.
Keep outer background and colour.
View 3 Replies
View Related
Jun 26, 2012
I am populating iProperty "Description" field using expressions from the custom fields. These custom fields are exported from the parameters.
Is there a way of typing in extra plain text into the field onto the end of the expression without losing the expression formula?
Inventor 2010 Pro SP4, Vault Collaboration 2010
HP Z820 Xeon E5-2643 0 @ 3.3Ghz 16.0GB RAM
Nvidia Quadro 5000
View 2 Replies
View Related