AutoCAD Visual LISP / AutoLISP :: Importing An Excel Column Into A List?

Sep 6, 2012

I am trying to import a list of customers from column A in an Excel file into a list for a popup_list for my Drawing Properties DCL.  I am having trouble finding information on how to do this.

Basically: Load the file, (workbook through active sheet: vlax-get-property)

(setq xlSheets (vlax-get-property xlBook 'WorkSheets) )

Then, how do I get it to put column A properly into a list for the DCL?

View 1 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Excel Sheet Column

Aug 13, 2013

I'm trying to get an excel sheet to open and count cells based on the text inside a selected column then compare it to cad. The column says "red" or "green" and I want to compare it to a count of red and green hatches in cad.

I managed to get them to be counted in cad but I'm not sure how to get the excel part to work.

Note: I posted an earlier post thinking to count the actually color in the excel cells rather than the words but that ended up being quite complicated.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Read Second Column From A CSV?

Oct 18, 2012

If I have a CSV file (with no header) that contains three columns and I want to return values of  the second column as a list, how is the best method to do that?

I have seen something where one can separate a string into a list by a divider (in my case, the commas between the three columns) but the actual code for me to inspect was supposed to be in an attached ZIP file which I didn't see as part of the post.

An example of my CSV (as a list) wouild be:

("PO-30-10,PIN OAK,88-15" "PO-30-10,PIN OAK,88-01A" "JS-20-5,JUNIPER,63-04" "PP-40-10,POPLAR,38-22")

and I need the resulting list to be:

("PIN OAK" "PIN OAK" JUNIPER" "POPLAR")

Is there a LISP way to do this - or only VLISP?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Table Column Widths

Apr 26, 2012

How to modify the column widths of an ACAD_TABLE?

I have known co-ordinates that I want each grip for the table to be set at.  I can't just copy and paste the table from drawing to drawing.  Each table of each drawing have different textual values, and the column widths will best be sized for each text value.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add List To A List

Jul 15, 2013

I have a list -

(setq List1 (list "Line A" "Line B" "Line C"))

I would like to add each item in an existing list to a new list -

(setq ListNew (list "This is some text" "This is more text"

the following is the part I can't figure out - it just adds the list to the list, not the individual items

(mapcar '(lambda (x) x) List1)))

I am looking for ListNew to be - (a list with 5 strings)

"This is some text"

"This is more text"

"Line A"

"Line B"

"Line C"

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adjust Column Width To Length Of Text

Apr 27, 2012

Several times, we generate a drawing, and the text widths in the columns vary greatly.  Some have text that is ten characters long, and others have thirty-plus characters.

Is there a way to be able to select the table (or perform the command to all tables in the current layout) and have each of the columns expand to the appropriate width, that depends on the longest string of text in that column, for each column.  The problem I see, is that some tables have two columns, some have six, and of course other with any number in between.  The same is also true for the amount of rows.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add String To Each Item In List Using Lisp

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

AutoCAD Visual LISP / AutoLISP :: Select Top Block Of Column And Get Bottom Left Bounding Box Corner

Jul 10, 2013

I have blocks forming a column, and I need to allow the user to select the top block of the column but return the bottom left corner of bounding box of the bottom block in the column. 

(DEFUN NXT-INSPNT (/ BLKLST CURENT CUROBJ IDX IPNT MCMD NENT SEL SS VENT) (PROMPT "
>> Pick the Category HEADER to add note:") (SETQss nilss (SSGET ":E:S" (LIST (CONS 0 "INSERT"))) )
(IF ss (PROGN (SETQ sel (ENTGET (SSNAME ss 0)) iPnt (CDR (ASSOC 10 sel)) )
(princ iPNT) (setvar "attreq" 0) (VL-CMDF "-INSERT" "LEG-NOTE" "S" 1 iPnt 0 PAUSE)

[Code] ....

 I'm not exactly sure where my code is failing but I get the following error.

error: AutoCAD.Application: Null extents

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Interacting With Excel - ExportAsFixedFormat

Aug 17, 2011

I wasn't able to find out any information on what format the parameters are required to look like when passed along with the Method ExportAsFixedFormat.

I'm currently using the following code to change the active printer followed by the printout command
 
(vlax-put-property XL "ActivePrinter" "DocuCom PDF Driver on Ne03:")(vlax-invoke-method XLS "Printout")

 where XL is my spreadsheet and XLS is the active worksheet.  This works but the printer controls filename and location.
 
(vlax-invoke-method XLS "ExportAsFixedFormat"

 I've found the ExportAsFixedFormat but can not find any documentation that shows how to format the parameters within LISP to send to Excel.

The object browser for VBA in Excel shows the following:
 
Sub ExportAsFixedFormat(Type As XlFixedFormatType, [Filename], [Quality], [IncludeDocProperties], [IgnorePrintAreas], [From], [To], [OpenAfterPublish], [FixedFormatExtClassPtr]) Member of Excel.Chart
 
I recording a macro and got the following that shows some additional information.
 
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _"C: est.pdf" _, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _:=False, OpenAfterPublish:=True
 
Is there any documention showing what this looks like when using the vlax-invoke-method?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Excel Coordinates To Table

Mar 19, 2013

I need to draw a table with point number, easting, northing, elevation for a lot of points and need a lisp to read the xl spreadsheet and draw the table.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Data From DWG To Excel?

Sep 4, 2012

I have Export data from dwg to notepad lisp programe. But i need lisp programe for Export data (Easting,Northing and Level) from dwg to excel.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Import From Excel Or Notepad To DWG

Sep 5, 2012

I have some coordinate in the excel file. How to import from excel to dwg. All coordinate i will make polyline. I know one method all coordinate copy and paste to command prompt. But i need script file or other method.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating Drawings From Excel

Dec 16, 2011

This probably isn't the correct discussion group but not sure where else to post this. 

My sales department wants to be able to create drawings based on entries in selected in their Excel qouting tool.  Basically, they want to configure a product in the field, and be able to show the customer the drawing with TrueView. (They don't have AutoCAD installed).

I would think the best I can do, is manipulate a .dxf file based on their selections but that may get very complicated.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Text To Excel

Jun 14, 2009

how create lisp convert text (from drawing) to excel

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Post HOSTNAME To Excel

Aug 26, 2013

Lisp routine that can write to an already existing XLS file?  What i need is an Excel file that will be updated with a users 'hostname' when they start AutoCAD.  I can get the hostname information with the below code, but I'm not sure how to get this value into an Excel file.

(getenv "computername")

Factory Design Suite Ultimate 2012
AutoCAD 2012 | Inventor Professional 2012 | Vault Professional 2012

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Call Excel Macro

Nov 10, 2012

i want to call an excel macro from a lisp. is it possible?

now i have this:

(startapp "C:\Program Files (x86)\Microsoft Office\Office12\Excel.exe"
    (strcat """
     (getvar 'dwgprefix)
     (vl-filename-base (getvar 'dwgname))
"XXX.xls""
)
)

i just want it to run macro1 from book1.xls

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Data From DWG To Excel

Sep 4, 2012

I have Export data from dwg to notepad lisp programe. But i need lisp programe for Export data (Easting,Northing and Level) from dwg to excel.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find Cellname In Excel

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

AutoCAD Visual LISP / AutoLISP :: Exporting Text To Excel

Jan 24, 2012

I am trying to export what looks like a table of text to Excel. The problem I have is the table is not an actual TABLE within AutoCAD but rather just columns of text with lines drawn around it. How I can grab this text and then put it into an Excel Spreadsheet.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Programmatically Import Excel Table?

Apr 25, 2013

I would like to link an AutoCAD table to an Excel file with the first method described in this page:

[URL]

I know the filename of the Excel spreadsheet and the range as well.

Is there a way to make a script that links the table and then detach the link after that ?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extracting Data From Excel File?

Jun 12, 2013

We have a custom LISP program (Written, upadated in 2003) that takes a keyed in item number, opens and searches a .txt file with four coulmns, for the keyed in item number (column 1) and returns a part number (column 2), description (column 3) and any information in column 4.

Here is the Part of the cod in question:

(setq recx (open "H:/ACAD2012/alcocustm/LISP/hardware.txt" "r"))
(setq d "?")
(setq rec (read-line recx))

[Code]....

A quetsion was asked if the data in the .txt file could be put in an Excel file. I tried looking at other post, but I can't seem to find a clear cut way to open and extract the data. Or this old dog overlooked a boand. Is there a easy way to do this, similar to the above?

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Any Way To Extract All Dimension Text At End Into Excel

Aug 16, 2012

I'm dimensioning an old drawing with the real (measured) dimensions and with the drawing dimensions in brackets (using ' 1500 (<>)' to give '1500 (1505)' for example.

What I'd like is to also be able to put on the difference between the length I type in and the length in brackets - as this would let me see any really glaring errors that can't be attributed to user-error on the laser measure.So I could type in '1500  (<>) (X)' where X is the formula, and get ' 1500 (1505) (5)' back?

How to be able to run a script that could highlight any dimensions where the number is brackets and the typed number have a a difference of, say, 50.Or failing that, any way to extract all the dimension text at the end into excel so I can see the differences myself?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sorting A List

Aug 17, 2012

I have a list that contains data like this,

"Tree-01-08-AA5"
"Tree-04-12-QV"
"Tree-10-30-QS"

How would I go about sorting this list by AA5, QV, QS? I know how to use vl-sort and reverse, but I do not understand how I would go about this. 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File Name In A List

Aug 26, 2012

I have a list like ("a.dwg" "b.dwg" "c.dwg") and an filename "b.dwg"

I want to know if the file name is a part of the list. which function must be used for this?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Scales To List

Oct 13, 2013

I need to modify the code below.

When I run the command and write the scale, I need to change the name of the scale and the ratio automatically. The ratio should always be in the format "1: #", also the name of the scale. Maybe assigning more variables with "setq", I do not know.
 
(defun c:test ()(setvar "cmdecho" 0)(setq name (getint "
Type the scale you need:"))(setq ratio (strcat "1:" "0.1"))(command "-SCALELISTEDIT" "Add" name ratio "Exit")(setvar "cmdecho" 1)(princ))

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: List To String

Jul 11, 2013

Here's one that I could use on that i can't figure out:

I have a list of a bunch of descriptions that looks like this:

("00.02.00" "CTD01 Mainframe PT1 (top)" "GD01")

What I am doing is grabbing the middle item and i need to break this up into 2 lines.  So, my code below grabs the first 3 "words" in the second item in the list and puts them in a list, but I need to convert this back to a string.

(setq desc6a (list (car (read (strcat "(" (cadr input6) ")" )))(cadr (read (strcat "(" (cadr input6) ")" ))) (caddr (read (strcat "(" (cadr input6) ")" )))))

I tried a bunch of ways but can't get it

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get The NEXT Element Of A List?

Apr 25, 2013

I've been experimenting with lists and I'm curious about the fastest / easiest way to get the next element from a list:

Currently my best shot is to wrap (member 2 '(1 2 3)) with: (car(cdr (member 2 '(1 2 3))))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Excel Macro To Zoom To Object In Current DWG?

Jun 14, 2013

I am looking for an example excel macro to zoom to an object given the obect entities handle.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Retrieve Cell Data From Excel File?

Oct 7, 2011

I would like to be able to retreive data from a sepcified cell, in a specified worksheet, from an excel file.

I don't have any clue how to connect to an excel file and read the data. Most seems to think you already had an understanding but I'm starting from the beginning.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Exporting List Of Objects

Jan 6, 2012

How to export to a txt file a list containg all the objects on the current layer and their properties?

To be precise, I would like to export the following items from a selection of plines:

- ObjectID;
- Start Point;
- End Point;
- Vertex Points;
- Width.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Appending Associative List

Jul 17, 2012

Here is the code snippet from my program, I am trying to build a associative list from two regular lists in the while loop.  Does ""append " or "cons" only work for simple lists? Given attributeNameList attributeValTypeList which are always of the same length

(setq listCntr 0)
(while (<= listCntr (length attributeNameList))
  (setq attrTagTypeAssnList (append attrTagTypeAssnList (list ((nth listCntr attributeNameList)  (nth listCntr attributeValTypeList))) ))
  (setq listCntr (1+ listCntr)
)

How can I dynamically build the association list.

View 2 Replies View Related







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