AutoCAD Visual LISP / AutoLISP :: Find Text And Get The Filename Where It Occurs
Jun 24, 2012
Actually I am not a Autocad Lisp person but I need to refer Autocad drawing for my workflow.
Is there a way in Lisp to find a certain, text or attribute in all files in a folder and if the file
contains that text to get the filename written to a txt file.
Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
Inventor 2013 and Vault Basic 2013
View 4 Replies
ADVERTISEMENT
May 24, 2007
What would be the ideal way to find out the overlapping text.
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
Jun 11, 2007
In order to avoid duplicate text string in different places in the same drawing, I would like to have such a tool to find duplicate text string.
For instance, I want to put numbering of some connection lines, I do not want to have different lines but have same number by mistype.
View 9 Replies
View Related
Jan 25, 2012
I'm looking for a lisp routine that can find and replace multileader text.
I want to replace "T." with "T+" and "B." with "B+".
All the multileaders are on layers with a suffix of "-elev".
View 9 Replies
View Related
Nov 27, 2013
find duplicate Text & highlight with any color (numbers or text string) ? I have a drawing and have to find duplicate text string, file is bigger and need make this automatic find, & highlight the duplicate text.
View 4 Replies
View Related
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
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
Jul 30, 2013
I'm trying to get the file name of a file outside the search path. Obviously (findfile) is not an option. The file location changes with each project so adding a search path is also not an option. I can get the path to the file but i can't seem to figure out how to get the file name. I can also get the first set of characters, as they are constant from project to project, it's just the end of the file name that changes. The file is always a PDF.
View 9 Replies
View Related
Oct 20, 2011
how to write a lisp command, or function, that will save my newly created drawing with a file name is that is called up from a variable.
For example:
(setq filename variable)
(command "saveas" "r14" "filename")
and i would want the outcome to be: variable.dwg, rather than filename.dwg. I have tried numerous different ways of doing this with command prompt and cant seem to get anything to stick. Everything that works just creates a file named "filename.dwg", which is not what i want to do.
View 9 Replies
View Related
Jun 9, 2004
how to check snap errors in drawing in a specified layer against some other layer. means first layer should end with second layer otherwise place error.both layers have linear features.
View 7 Replies
View Related
Dec 24, 2013
My drawing constitutes of many blocks and other objects , and i need to find specific blocks (with same block name) in my drawing which i cannot find them one by one and i though that i can find them all with lisp routine ..
so , i wanna specify point out of my drawing area and lisp routine will draw to line from basepoint of those blocks to specify point when i select one reference block.
View 4 Replies
View Related
Jun 25, 2012
I would like to get the cell with a specific name in Excel.
In Excel you can give a cell a custom name like "Project_Name".
How do I get the sheet and cell(row,column) of the cell with this custom name ?
View 6 Replies
View Related
Nov 1, 2011
We use multi-leader objects in our drawings. When the multi-leader and its value are to be replicated throughout the drawing, we create mleaders with fields that show the contents of the first mleader. That way we can update only the value in the first mleader and all of its children will update as well. It works nicely for us.
Here comes one snag. If one of us opens a drawing with which we are not intimately familiar, we don't know which mleader is the parent of which children. There might be fifty parents and four hundred children in a drawing so going through them by hand is a big productivity drain.
What I need to do is write a routine that will let the user select the mleader that includes the field and have the routine highlight and/or zoom to the parent object.
I thought I should be able to find that info in the dxf codes for the mleader, but I am either missing it or it's not there.
View 3 Replies
View Related
Sep 22, 2011
Where I can find the DXFIN command code? I want to examine it to see how it does what it does.
View 2 Replies
View Related
May 8, 2013
I want to know the correct way to find the offset origin of a layout in an AutoCAD drawing. Let say I have a drawing that has many items on it. And I create a layout showing just the items in the lower right corner of the drawing. I want to know the offset origin of this layout relative to the Model space.
I came across some LISP commands that are supposed to do just that:
(vl-load-com)(setq activelayout (vlax-get (vla-Get-ActiveDocument (vlax-Get-Acad-Object)) 'ActiveLayout ))(setq activeplotorig (vlax-get activelayout 'PlotOrigin))
Unfortunately, the commands don't seem to work because it always returns (0.0 0.0). That cannot be right.
View 1 Replies
View Related
Jan 27, 2012
How can I find a block with a specific name and get what the coordinates are? What we have is our Bill of Material is attributed blocks. I am attempting to change the first one. Well all of the lines that list the parts are seperate blocks with the same name. Now the Top Line of the Bill of Material is a different named block. If I can find the coordinates of this block I can then select the first line to do what I need to.
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 3 Replies
View Related
Jan 29, 2003
Using Lisp or VLisp, how can I find the Start & End Point of an AEC_WALL ent. ?
View 5 Replies
View Related
Feb 2, 2012
Further to my earlier topic for getting the viewport scale which has been nicely solved, I am looking for a way to get one of the corners of the viewport outline 'drawn' in modelspace so that I can add the name of the spcific layout Tab to which it relates in a location that suits the drawn outline.
The code that I am adapting came from the thread titled Outline projection all viewports to model..The routine appears to pick up the corners of the viewport in paperspace and tranform/translate them to modelspace co-ordinates.
(defun _trans (p) (cons 10 (PCS2WCS p ent))) (defun _cornersFromBBox (o / a b) (vla-getboundingbox o 'a 'b) (setq a (_trans (vlax-safearray->list a)) b (_trans (vlax-safearray->list b)) ) (list a (list (car a) (cadr a) (caddr b)) b (list (car b) (cadr b) (caddr a))) ) (if (setq ss (ssget '((0 . "VIEWPORT"))))
[code]....
View 4 Replies
View Related
Feb 26, 2010
I work with polylines a lot to maintain Facility Space and I come across polylines that are overlapping. Is it possible to have a routine to find polylines that are overlapping? Sometimes I really have to zoom in pretty close to see if they are overlapping and sometimes it's pretty obvious.
View 9 Replies
View Related
Nov 18, 2013
the names of the function to establish the plotting parameters using the (vlax-get-property <name> <parameter> ) method. For example the plotting device name is obtainable by (vlax-get-property <objectname> 'Configname).
What "words"/parameters do I use to find the plot orientation and paper size?
View 9 Replies
View Related
Jul 13, 2011
finding each objects Position XYZ and Rotation XYZ using LISP. It looks like position is a pretty easy one but rotation data is a bit elusive.
View 9 Replies
View Related
Jul 17, 2013
I having real difficulty finding a lisp that will find and replace blocks. There are plenty out there and AutoCAD 2013 and lower has a Find and Replace Blocks. However, the frustrating catch is I can seem to find a routine that will allow me to replace only those blocks that I select with a selection set of my choosing. The built in function replaces all of them and will not let you exclude some. We have PID drawings that we want to replace valves on, but not all valves. We don't want to rename. We don't need to BEDIT the existing block.
1) Pick group of blocks
2) specify a new block that will replace all instances of old block
3) replace inserted block with different block. Leaving others alone.
I'm thinking this should be easy, but my search has failed. The blocks in question are not dynamic or attributed either.
View 3 Replies
View Related
Jun 7, 2010
I have a “PART” block with attributes tags “PARTMARK” and “SHEAREDFROM” inserted 5 to 10 times in 10 to 50 drawings.
The “PARTMARK” value is always a unique number entered in autocad.The “SHEAREDFROM” value is calculated in Excel and exported to a “SHEARED.txt” file.
In each “PART” block I need to replace the “SHEAREDFROM” value based on the unique “PARTMARK” value, using a script that uses (or incorporates) the values from the “SHEARED.txt” file.
So far the only solution I’ve come up with is having a unique value for the “SHEAREDFROM” and –attedit to change the values in a script. However if the script doesn’t encounter a "K20-1S" in the first drawing it errors out and doesn’t proceed to the next. Below is an example of my rudimentary script.
(command "-attedit" "n" "n" "PART" "SHEAREDFROM" "K20-1S" "K20-1S" "8-60x192")
(command "-attedit" "n" "n" "PART" "SHEAREDFROM" "K20-2S" "K20-2S" "2-60x144")
(command "-attedit" "n" "n" "PART" "SHEAREDFROM" "K20-3S" "K20-3S" "2-60x132")
(command "-attedit" "n" "n" "PART" "SHEAREDFROM" "K20-4S" "K20-4S" "4-60x120")
(command "-attedit" "n" "n" "PART" "SHEAREDFROM" "K20-5S" "K20-5S" "0.7-60x120")
I’m assuming I need LISP to do this, but my LISP skills are limited. I think I would need a setq for each unique shearedfrom value (setq K20-1S (“8-60x192”))? Then somehow search each drawing for the unique shearedfrom value to replace.?
View 9 Replies
View Related
Feb 15, 2012
I have a lisp routing that the user has to use, to create a ucs, that is exactly on the front of the entity the user selects, so that whne they are drafting, labeling, dimensioningn the 3D entity, none of the drating lines are hidden when plotted.
The code is as follows:
(setq obj (vlax-ename->vla-object ent))
(vla-getboundingbox obj 'LowerCorner 'UpperCorner)
(setq LowerC (vlax-safearray->list LowerCorner))
(setq UpperC (vlax-safearray->list UpperCorner))
[code]...
Then I do a condition to see which points are greater than others, and move the ucs depending on the view to the foremost point. The program works perfectly.... however, often, they forget to use it.
I was wondering if I could incorporate it in another lisp that everyone uses, but not having the user pick the entity they want to be in front of (sometimes they pick the wrong entity). Instead, take the group of entities (anywhere between 1 to 30 per drawing (these are piping spools, so the entity count is not that great in model space)) and set a front working plane in model space. Working in paperspace is not an option, we're just too deep into our templates and processes.
I know there is a vmin and vmax, but they are for the X and Y axis, a VMax along the Z-axis would be great.
View 5 Replies
View Related
Dec 17, 2012
Im having a little trouble of late understanding how to undertake an action/ command if nil
what i do know id the following:
(setq TESTvar(findfile "acad.lsp"))(alert TESTvar)
this gives me the path of the acad.lsp, that is provided it actually exists, however because the acad.lsp is not compulsory it may indeed not exist meaning that the command prompt would return the NIL value instead of the pathname.
based upon that I would like to create a new acad.lsp file if not found by autocad.
View 3 Replies
View Related
Dec 5, 2011
I need one lisp to get invert levels, I am having Invert levels and cordinates of two points of an arc how can I find invert level of a point middle of tht arc?
View 9 Replies
View Related
Aug 8, 2013
Let's say I have a 3D polyline, which I turn into a spline. I then want to determine how closely the original polyline and spline follow each other. How I can check this programmatically? The concern is to find the maximum deviation and its location.
Howto be able to run the check on other types of objects as well: arc, polylines etc.
View 6 Replies
View Related
Sep 20, 2011
How would I go about this. if a two blocks or polygons are overlapping area?
A good method or the algebraic formula for a function to tell me if a point is inside a polygon or block's area?
View 5 Replies
View Related
Dec 11, 2012
how I could open an external .CSV file which is assigned to a variable called INFOFILE and scan line by line and replace each instance of the string "WIDGETTE" with the string "WIDGET"? I assume the function vl-string-subst woud be involved.
View 9 Replies
View Related
Sep 20, 2012
We have user folders on severall servers, now I want the user menu's to be stored on the network so their home folder depends on what server it's located on. I tried using the vl-file-directory-p command but it doesn't seem to work.
Even worse, as soon as the userfolder is found I want to let the script check for a file called user.cuix in the Acad folder and if it doesn't excists copy it from another location to that folder (if possible).
This is what I got so far:
(setq UserName (getvar "loginname"))
(setq RootZW "\\users\zw\")
(setq RootVL "\\users\vl\")
(setq Company "\\CADConf\ACAD13\")
[Code] ..........
Next to this we have 4 other options as well, but to keep it short I left it at the first 2.
View 2 Replies
View Related