AutoCAD Visual LISP / AutoLISP :: Why Vla-FullName Returns Values In Lowercase

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


AutoCAD Visual LISP / AutoLISP :: Executing Command If Find File Returns NIL

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

AutoCAD Visual LISP / AutoLISP :: Attribute Blocks - Change 1st Tag Values Automatically According To 2nd Values

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

AutoCAD Visual LISP / AutoLISP :: Sum Of Attribute Values

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:

128 RP
389 TD1
2389 SP4

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sum Attribute Tag Values

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

AutoCAD Visual LISP / AutoLISP :: Adding Up Attribute Values

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

AutoCAD Visual LISP / AutoLISP :: Select All 3D Polylines With Same Vertex Z Values

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

AutoCAD Visual LISP / AutoLISP :: How To Retrieve (2) Attribute Values From One Block

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:


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

AutoCAD Visual LISP / AutoLISP :: Extract Values X Y Z From Vlax-3D-point

Jan 3, 2012

how to extract value X Y Z of point p3 p4

(defun c:test ()
  (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)


View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Attribute Values From Multiple Blocks With Same Name?

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.

(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

AutoCAD Visual LISP / AutoLISP :: Deleting Text That Is 10 Values Long / Less

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

AutoCAD Visual LISP / AutoLISP :: Remove All Block Attribute Values

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

AutoCAD Visual LISP / AutoLISP :: Looping Through Attributes And Store Values?

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

AutoCAD Visual LISP / AutoLISP :: Getting Routine That Will Sum Selected Text Values?

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

AutoCAD Visual LISP / AutoLISP :: Inserting Attribute Values Into MySQL

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

AutoCAD Visual LISP / AutoLISP :: Polyline Z Values Not Being Returned By Vla-get-coordinates

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

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 :: Values Not Appearing In Command Line

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

AutoCAD Visual LISP / AutoLISP :: Insert Block And Fill In Attributes With Var Values

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???

(defun c:JD ()
  (setvar "attdia" 0)
  (setvar "attreq" 1)

[Code] .....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Script To Change Duplicate Tag Names And Their Values?

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

AutoCAD Visual LISP / AutoLISP :: Export / Import Attribute Values And Its Color

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

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

AutoCAD Visual LISP / AutoLISP :: Extracting Attribute Values And Assigning To Variables?

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

AutoCAD Visual LISP / AutoLISP :: Measure In Millimeters But Display Values In Meters?

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

AutoCAD Visual LISP / AutoLISP :: Block Attribute Values In Paperspace Multiple Pages

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

AutoCAD Visual LISP / AutoLISP :: Update Radio Button Default Values In Dialog Box?

Apr 3, 2012

Rudimentary lisp & dialog box skillls here...

I have a little dialog box with seven radio buttons and a text box that generically accomplishes what it's supposed to do. To retain the current dialog values, I use the write-lline function to store the information and then use read-line to bring that information back in for other Lisps that I use. As long as the user doesn't open the dialog, whatever options were last selected will remain in effect.

However, if the user re-opens the dialog, then whatever defaults I have initially set up in the dialog will then become active (in other words, whichever of the radio buttons I have set to "1")

My question is whether or not I can have the dialog box set up so that if a user selects an alternate radio button, that radio button will keeo it's value whether or not the dialog is opened and until and if the user changes it..

As it is now, whenever the user opens the dialog box to change, say one radio button, the user then has to change the other radio buttons if the defaults don't match the current run requirements.

Here's the dialog and the lisp:

OPTIONS : dialog {
label = "   Counter to Cad Options";          
: spacer {
height = 0.75;

[Code] ......

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extracting Attribute Values From Multiple Dwg Files To An Excel File

May 11, 2013

how to extract the attribute value of a  particular block in multiple drawings to an excel file.

Eg... there are nearly 800 drawings where I need to list down the description and Drawing number which is mentioned in the title block name "Title". The Drawing Number and the description is done in same attribute block. extract the data into an excel file or txt file. All the drawings are saved in one location.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Read Excel File To Insert Text Values At Coordinates

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

AutoCAD Visual LISP / AutoLISP :: Intersect Between Two Lines Using Start And End Values Of Two Lines

Oct 11, 2013

With all of you fine teachers, I have the know-how to get the start and end values of a line.

Do you think there is a way to get a point returned that represents the true intersection of the two lines, without having to involke a user defined "getpoint" function using "intersect" osnap?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Transfer Attribute Block Values To Another Attribute Blocks

Jul 3, 2012

I wanna transfer my attribute block values to another attribute text blocks , is there any lisp for that?

Is there a possibility for sum tag values of choice attribute blocks to inside of another attribute text block ?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Match Multiple Attribute Values From One Block To Another Block

Feb 12, 2012

I need to match few attribute values from one block to different block. I download a lisp file called; ca.lsp which can match the single attribute value. I modified it for more than one attribute value matching. It is ok but still wish to overcome two issues for batch prcess

1. picking up the blocks by selection

2. click the alternative block numbers of times to match the numbers of attribute values I needed.

How to modify this lisp I can run it by block name selections instead of picking selection which enable me to run batch process for numbers of drawing? That will be good...

Lisp & Demo file attached (Match attribute value, A, B & C to Attribute 1, 2 & 3).

View 3 Replies View Related

Copyrights 2005-15, All rights reserved