AutoCAD Visual LISP / AutoLISP :: Automatically Delete Text With 5 Or Less Numerical Values?
Dec 29, 2011
Automatically deleting all text entities that do not include 5 or more numerical values.
By numerical value i mean a whole number 1-10.
Selecting certain text based on criteria would be useful.
View 6 Replies
ADVERTISEMENT
Jul 18, 2013
I have an attribute blocks and this att block has two tag values , is there a simple code for to change 1st tag values automaticly according to 2nd values ?
for example :
1st tag (50x50) - 2nd tag ( 100 ) ==> 50x50-100
if i enter 201 valuse to 2nd tag then 1 st tag has to change as 100x100
if i enter 501 valuse to 2nd tag then 1 st tag has to change as 150x510
I attached a jpg file for explain much better
View 9 Replies
View Related
Feb 13, 2013
Is there a LISP routine in Civl 3D 2013 that would add a specific numerical amount to text? IE: I have a sewer label as "Top=100.00" and I wanted to add 0.30 to the text so that it reads "Top=100.30".
There used to be an old R14 LISP known as ADDTXT that I used that worked great for this.
View 2 Replies
View Related
Dec 16, 2011
I often have DXF files that contain very many short (10 digits or less) instances of text, and only a few long instances of text (11 digits or more)....
I would like to use AutoLISP to delete all of the short text in my DXF file, but leave the longer text.
View 9 Replies
View Related
Jun 2, 2004
lisp routine that will add together the values of text entities? For instance, if I have a big parking lot and each section is labeled with the number of spaces, I could pick the texts and it would add all the numbers together to give me a total. Right now I export to excel to do this. I have quite a few situations where this would be handy, not just for parking spaces, so I really just want a lisp that will add all my selected numbers.
View 9 Replies
View Related
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
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
Mar 6, 2013
I got a new work and get it done in the next 2 days, but first I need to do this... from a text file (or excel file, I got both) I got 3 columns, 1 one for node number, and 2 other for X and Y coordinates for each node.
So from that file I need to insert into autocad the node numbers as text (using the current style and height) at the point specified by the other two columns, that are the X,Y coordinates which will be the insertion point of text..
View 5 Replies
View Related
Jul 29, 2005
Say I have a block that contains two attributes, one contains a value that is a number and another contains a value that is letters. I have many of these blocks placed in a drawing, could you create a lisp that would return the sum of the number value and return it to the command line along with the letter value. Something like this:
Sum--------Item
128 RP
389 TD1
2389 SP4
View 9 Replies
View Related
Jul 17, 2013
Lisp or lisp code for sum attribute tag values and paste result to an another attribute block tag?
i attached jpg for explain to what i want to do .
View 4 Replies
View Related
Oct 26, 2012
Any routine where I could keep picking on my exit arrow blocks (showing how many persons exiting from each space) one-by-one and the program would add up the numbers. For example I pick on blocks with numbers of 2, 4 & 3 and I would get 9.
View 3 Replies
View Related
Jun 17, 2012
I need to wright a routine in autolisp that selects all 3Dpolylines with the same vertex Z value.Qselect as no transparent mode and filter doesn't work.
View 7 Replies
View Related
Aug 24, 2011
Here's my situation:
I have a block named "WIDGET-A". And in that block are (4) attribute tags whose names are:
"ID"
"TAG01"
"TAG02"
"TAG03"
The user will be prompted to pick the value displayed at any of the "TAG##" attributes - they will select the attribute tag they want (we don't know which one it is, we just want to assign that value of the attribute tag they clicked on to a variable called "VAR2".
Now, what we also want AutoCAD to evaluate, behind the scenes, is the value of the attribute tag named "ID" which we know always exists in the block and then assign that value to a variable called "VAR1".
Is there a way for AutoCAD to do this all from only a single user pick on top of an attribute value, in a block whose name isn't always going to be 'WIDGET-A' either.... But the block, whatever it's name, will always have the attribute tag "ID" with a value in it, and we always want to capture the value of whatever attribute tag within the block that the user clicked on.
View 2 Replies
View Related
Jan 3, 2012
how to extract value X Y Z of point p3 p4
(defun c:test ()
(vl-load-com)
(setq actdoc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq objm (vla-get-ModelSpace actdoc))
(setq obju (vla-get-Utility actdoc))
(setq oldhigh (getvar "Highlight") oldsnap (getvar "Osmode") oldblip (getvar "BlipMode") oldecho (getvar "Cmdecho") );setq
(setvar "Highlight" 0) (setvar "Osmode" 517) (setvar "Cmdecho" 0) (setvar "Blipmode" 0)
[code]....
View 4 Replies
View Related
Mar 21, 2013
This time I'm wrestling with getting the values from multiple blocks. The blocks all have the same name but at least the attributes have names this time. Each block have exactly 4 attributes, like: att1 (a number representing chronological order), att2 (some data), att3 (the actual date as a string of when the data was added), att4 (some more data)
I need to get and store the attribute's values. I was hoping to make a selectionset of the blocks and step through using the chronological order number.
At this point I have tried several combinations of foreach and ssget "x" (list (cons 2 MYBLOCK)), but I keep getting errors that I'm sure are telling me that I'm not passing the correct information to the function for iterating through. I'm banging my head.
(DEFUN c:GFOR (/ ATTLST REVBLK CNT CNT1 BLK RBLK ATTVAL ATT REV#)
(SETQATTLST(LIST "R#" "INIT" "DATE" "DESC")REVBLK(ssget "x" (list (cons 0 "INSERT") (cons 2 "REVISION")))CNT0CNT10 )
(vlax-ldata-put "dict" "RevTotal" (BLKCNT "REVISIONS")) (FOREACH BLK REVBLK (SETQ RBLK (ssname BLK CNT1)) (setq ATTVAL (mapcar '(lambda (x) (vla-get-TextString x)) (vlax-invoke (vlax-ename->vla-object RBLK) 'GetAttributes))) (foreach ATT ATTLST (SETQ REV# (STRCAT "REVISION" (1+ CNT)))
(vlax-ldata-put "dict" REV# (member ATTVAL)) (setq CNT (1+ CNT)) ) (SETQ CNT1 (1+ CNT1)) ) (PRINC))
View 9 Replies
View Related
Jun 17, 2013
I need a lisp sub-function that can empty all attributes of a specified dynamic block. The idea being that the specified block contains data that changes often and in order to repopulate the block's attributes with new data to replace the old I wish to just blank out the old data first, because it's possible that the new data may not utilize as many attributes and all of the old data must be removed.
The thing is the block I'm after is on several layouts, CTABs and they all need to be wiped clean.
View 9 Replies
View Related
Mar 19, 2013
I have an interesting challenge. I am tasked with updating old drawings. The only difficulty that I've run into with the old files are that the TitleBlocks are all done with all of the attributes are named "SPEC". There are 90 attributes. I'm really struggling with getting each attribute's value and then storing the value to a variable so that I can then put that value into a new TitleBlock. The old TB will be deleted to avoid future confusion in the file.
(To clearify, the old TitleBlock is in model space, while there are actually nine new TitleBlocks all in seperate paper space Layouts, and this program may have to run on hundreds of files.)
getting the values from the Old TB. I need them in order of first to last or last to first (either way will work since I have the variable names in a list that can be reversed if necessary.)
simple function to read through the block's attributes in order and store the attribute's value to a variable name in the seperate list (also in order)?
View 5 Replies
View Related
Jan 18, 2012
How to connect to MySQL database and insert data from a set of blocks containing attributes?
Something like:
block 1:
- x coordinate;
- y coordinate;
- handle;
block 2:
- x coordinate;
- y coordinate;
- handle;
block 3:
- x coordinate;
- y coordinate;
- handle;
I've just got the second part (retrieving info from the blocks), but when it comes to connect to the DB I'm completely lost.
For the DB I'm using XAMP for Windows, thus using localhost, user ('user123'), pass ('pass123') and table ('table123'). The table has ID (PriKey and AutoInc), px, py and hdl fields.
View 9 Replies
View Related
Jan 11, 2014
Would you tell me why [b]vla-FullName[/b] returns a path in LOWERCASE (except of "Program Files" and other special folders) ??
View 9 Replies
View Related
Sep 8, 2011
I have a 2 point LWPOLYLINE that has the following coordinates at its end point when I 'ID' the point.
Command: id
Specify point: end
of X = 709369.3214 Y = 7153039.9690 Z = 269.2143
However if I use..
(vlax-safearray->list (vlax-variant-value (vla-get-coordinates (vlax-ename->vla-object (car (entsel))))))
I get this
(-450567.0 269.288 -450570.0 269.214)
and if I 'dump' the object..
; Coordinates = (-450567.0 269.288 -450570.0 269.214)
; Document (RO) = #<VLA-OBJECT IAcadDocument 09855674>
; Elevation = 7.17399e+006
I don't have a clue where the '-450567.0' is coming from.
I'm in Model Space in 'World' UCS, and I'm confused.. why does the 'ID'd' value not reflect whats going on when I use the vla-get-coordinates approach.
There are many other LWPolylines within the same model that behave normally.
I've attached the drawing (I think!)
View 7 Replies
View Related
Jul 23, 2013
I cannot determine what triggers this but the command line has stopped returning values from lisp expressions.
eg. If I type (setq fred "Hello") I would expect to see "Hello" returned. I am getting nothing. Similarly if I type !fred I get nothing. If I restart AutoCAD the problem goes away. The after some time it happens again. Is there a toggle or switch or system variable that I'm not aware of?
View 4 Replies
View Related
Jan 25, 2013
I know that for layers ON/OFF in current open dwg file, I should use:
[I just want to On/Off for my "STAMP" layer]
(COMMAND "LAYER" "ON" "STAMP" "")
(COMMAND "LAYER" "OFF" "STAMP" "")
but I have more than 150 dwg file and I should open all of dwgs one by one and setting ON/OFF for STAMP layer for every drawing and it takes so much time!
I just want to select files and LISP program set the STAMP layer to ON or OFF value.
View 5 Replies
View Related
Nov 4, 2011
I am using 2008 and I have a dynamic block with attributes that I want to insert with the below program and have the attritute values filled in automatically. I have done this with other programs in the past and they worked great with literally no problems. They were not dynamic blocks may be the reason this does not work. Why the block will not fill in the attributes like it should. Occasionally in my testing I see a message about "units" when I am inserting the block but I have my insunits set to 0. I have attached one of the blocks I want to use. I am thinking either you cannot do this because it is a dynamic block or there is a new variable that won't let it work.
(setq upisosym "L:/AcadUtilsJack/Programs/InsertIsoSymbols/ELL90BW_Flip_01" isosym "rat")
(setq upod "3" upsch "sched" upmatl "matl" uprat "400")
I found these two new variables and turn them off or 0 thinking they might be the problem???
(setvar "INSUNITSDEFTARGET" 1)
(setvar "INSUNITSDEFSOURCE" 1)
(defun c:JD ()
(setvar "attdia" 0)
(setvar "attreq" 1)
[Code] .....
View 9 Replies
View Related
Jun 17, 2012
I need to change the value of some tags in a title block on multiple drawings. I tried using Lee Macs attribute changer [URL]. It works fine but not when tags have the same name.
I then looked at this code - [URL]
Idea was to change the tag names then use Lee Macs program. It too fails when there are duplicate tag names. It changes all tags not just the one I want.
In the the title block I have 3 tags with the name "NAME" but only one will have the value I'm looking to change. If I could place an IF statement some where in the above codes (or another code altogether) to instruct that IF the tag name is "NAME" with value "Dennis (BSL)" then change either the tag name or the value to "Daniel"
Im pretty bad at this programming stuff but with so many drawings I need a easier, automated way of doing this.
View 1 Replies
View Related
Apr 24, 2012
There is a BLOCKA that I'd like to extract its attributes - Tag and Color - into an external format (excel). There after, I'd like to import it into the drawing and based on its color attribute value, change the value to that color in the drawing.
View 7 Replies
View Related
May 27, 2013
How can specific attribute values be extracted from a drawing and assigned to a variable in lisp.
The existing title block is having attributes : Area, Sub area, Description, Drawing type. I want to extract this values and assign it to some variable which I have already listed and then it shall be assigned to some other attributes in the same drawing with Area1, Subarea1, Description1, Drawing type1... and so on.. Both the attributes shall be in the same drawing file.
View 3 Replies
View Related
Jul 13, 2010
The attached lsp puts tick marks at equal distances along a line/polyline and tags them with the distanace value from the start point. I draw using millimeter units but things like chainage should be displayed in meter units. Using this routine displays the values in millimeter units which I then 'find and replace' to edit their values to meters.
Take a look at the lisp to see if it can be altered to input the mm value at the start but output the meter value to the text values?
Attached jpg graphically shows my request.
View 9 Replies
View Related
May 29, 2012
I want to find a Lisp routine for building rooms (bedroom, bath, kitchen etc). example: I want to build a bedroom and every bedroom has the following blocks: smoke detector, door, window, bed, night stand, closet. Is there a way to run a lisp routine that would just ask me for basepoints and rotation angles of all those blocks? Basically it would automate building a bedroom by inserting all the blocks for me and just prompting me for basepoints + rotation angles.
Would a macro be better suited for this? I want to do one for every room - kitchen, bath, bedroom, living, dinning etc. I already have a nice collection of blocks.
View 5 Replies
View Related
Jan 10, 2013
I am looking for a lisp that will rename all the layouts automatically. I tried the Layoutlist function but the output is not in order. Is there anyway that i can get all the layouts in a drawing from left to right order. for eg. i have layouts from layout1, layout 2........layout10). The layoutlist returns as layout1,layout10 etc...instead of layout 1 layout 2.
View 4 Replies
View Related
Nov 10, 2011
I am looking for a lisp routine which will allow me to mirror an object that I pick automatically. I don't want to have to pick the two points to set the mirror line. I just want the point I pick on of the object I select to be the point of the mirror. If that can't happen, I was wondering if the object could mirror at its insertion point (like if it were a block or a text.
View 7 Replies
View Related
Feb 25, 2013
I have several title blocks each in their own paperspace pages. Could have the attribute filled in, but more than likely only one page will have values filled in the attributes. I am looking for a VL method for finding which pages title block is filled in so that I can get those values and fill in the equivalent attributes for all of the other pages. Currently I am using a long set of :
(IF (setvar "ctab" "8.5x11") (IF(TBLSEARCH "BLOCK" "TB-8.5x11") (IF (/= "" (get-att "OWNER" "TB-8.5x11")) ; Function to read a named attribute(editblk "TB-8.5x11") ; Function to pull up the attdia(IF (setvar "ctab" "11x17") (IF (TBLSEARCH "BLOCK" "TB-11x17") (IF(/= "" (get-att "CUSTNMFIRST" "TB-11x17")) (progn ; At the last page ditch the [Code]..........
The example is just a very simplified version of what I'm doing. I just need to find the information, if it exists in any page and store it for later. Afterward, I'll fill in each page's Title Block with the stored information.
I know that this can be done much more efficiently. As I am currently flipping through the pages too much action is occurring on the screen and it makes some people nervous. With VL I should be able to run the search quietly, but I would still like to (setvar "ctab" "to the page with the filled attribute value") after the LISP is finished storing values.
View 7 Replies
View Related