Jump to content

Search the Community

Showing results for tags 'excel'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions


  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

  1. Hello everyone, i'm in need of help cause my function 'WriteRelativeToXls' for writing passed values behaves randomly and unexpectedly The passed arguments and some 'outside' data you can see in submitted log.txt and the result in Book.xlsx where you can see marked in yellow the wrong values it produces and i can't figure out why ;;;******************************************** (defun setcelltext (cells row column value) (vl-catch-all-apply 'vlax-put-property (list cells 'Item row column (vlax-make-variant (vl-princ-to-string value) 8 ) ;_vlax-make-variant ) ;_list ) ;_vl-catch-all-apply ) ;_defun ;;;*************************************************************************** (defun WriteRelativeToXls (station hdistances z_values / i col) (tv:StationIntoText station) (vla-put-name xlsheet (strcat (rtos pocetna_stac 2 0) "-" (rtos zavrsna_stac 2 0))) (setcelltext xlcells stat_row 1 stattxt);;funkcija upisuje u excel (setq col 1 i 0 xlrow_txt (strcat (itoa stat_row) ":" (itoa stat_row)) xlrownext_txt (strcat (itoa (1+ stat_row)) ":" (itoa (1+ stat_row))) ) (setq xlrow (vlax-get-property xlsheet 'Range xlrow_txt) xlrownext (vlax-get-property xlsheet 'Range xlrownext_txt) ) (vlax-put-property xlrow 'NumberFormat "0.00") (vlax-put-property xlrownext 'NumberFormat "0.000") (repeat(length hdistances) (setq col(1+ col)) (setcelltext xlcells stat_row col (rtos(nth i hdistances)2 2)) (setcelltext xlcells (1+ stat_row) col (rtos(nth i z_values)2 3)) (setq i(1+ i)) ) (vlax-invoke-method(vlax-get-property xlsheet 'Columns)'AutoFit) ;_ vlax-invoke-method (setq stat_row(+ 3 stat_row)) ) ;_ defun Book1.xlsx log.txt
  2. Quickly exports a table of Lines and Texts or Attribute blocks to a Table For the table of unknown attribute blocks, please use BURST command to burst all blocks first. General Usage Instructions BlockToExcel - Export table of attribute block or Lines and Texts to excel You can download the supported table styles from here https://www.mediafire.com/file/4u2zun3l12smtjc/Table_English.dwg/file If your table includes Lines and Texts or Unknown attribute blocks: 1. Run the BURST command to explode all attribute blocks 2. Run the B2E command. - Select all exploded objects. - Specify steel layer (if any). - Enter to finish command. Download: https://apps.autodesk.com/ACAD_E/en/Detail/HelpDoc?appId=4761456461459704560&appLang=en&os=Win32_64 Source: www.lisp.vn
  3. cmangi86

    Import Excel to DWGPROPS

    I work as an engineer for a solar company. We preform all of our calculations on an excel file, then transfer these values to Autocad to show our calculations for the plan checkers. I use the DWGPROPS command in Autocad to auto populate all the pages in my plans. I tend to do a lot of copy and pasting and to do all this. Is there a way to isolate the excel values I need and import them into my Autocad DWGPROPS?
  4. Greetings my friends I need some help with this lisp, this lisp (Medz v3.lsp) it basically makes a measurement of all lines arc and put the results in an new excel file divided by layer, linetype, color and length, this lisp works well but i need help to make the follow a modification: I need that the results to be in a specifc excel file (see attach xlsx file) on the "MED AUX" tab with the range A11:D11, it seems a simple modification, but i don't have the knowledge to do it. Many thanks MedZ v3.lsp Mede Aux.xlsx
  5. Our company uses "hand" as the style for all our projects. I need to import a table from excel with excel formatting. After I change all the text to "hand" style I can't figure out how to change the font. Any help would be greatly appreciated!!
  6. Hai, i need a help. I have a working lisp routine which gives me distance(chainage) of polyline when clicked on the pline i selected. It will add a text there showing chainage. Only thing i want is i need the chainage also in an external Excel Workbook cell. Like when i click and get the chainage there i want to get that chainage in excel workbook cell which is open (like Click to Xls lisp). Pls reply if its possible... thanks Attaching the lisp file and also adding same lisp code below. ;-- PIPE CHAINAGE abhi- CAA -- (defun c:CAA (/ s p c tp sch f) (setvar "cmdecho" 0) (setq sch (getstring "\nSpecify start chainage : <0>")) ;"0" is set as the default value (if (= sch "")(setq sch "0")) (if (and (setq s (car (entsel "\nPick a polyline :"))) (or (= (cdr (assoc 0 (entget s))) "LWPOLYLINE") (alert "Invalid object! Please pick a polyline only.") ) ) (while (and (setq p (getpoint "\nSpecify point :") ) (setq c (vlax-curve-getclosestpointto s p)) (setq tp (getpoint "\nSpecify Point for Text : ")) ) (setq di (vlax-curve-getdistatpoint s c)) (setq f (fix (/ di 1000.0))) (setq di (- di (* f 1000.0))) (command "_.LEADER" c tp "" (strcat "FF-LINE 01" ) (strcat "CH=" (itoa (+ (atoi sch) f)) "+" (rtos di 2 3)) "" ) (vlax-put-property (vlax-ename->vla-object (entlast)) 'height 3.50);;; Text Height 3.50 ) ) (setvar "cmdecho" 1) (princ) ) (vl-load-com) LINE CHAIN & CORDS - CAA.LSP
  7. Hi everyone, I've got the following problem: I have a lot of drawings and I need to edit the single fields of each of their title blocks by editing the values in an Excel spreadsheet. I've searched on the web but I couldn't find an optimal way to achieve this. I've found many tutorials regarding sheet sets; the problem is that many of the fields I need to edit are different from each other (in other words, I need to edit the "Date" field of each drawing, that can be the same, and it should be ok... but I also need to edit the "Material" field only of certain drawings, and that wouldn't work). Excel-driven title blocks could be really handy since I've got a better overview of all of the drawings, and it's easier to edit. What is the proper way to do this? Thanks in advice.
  8. Hi everybody, I am converting some excel formulas to Visual Lisp. I found a difference between results of a same follwing formula: (I changed cells to numbers to simplify the problem.) in Excel: =0.6*2400*1.15*1170*1.1/100000 ---> result: 21.31272 In AutoLISP: (/(* 0.6 2400.0 1.15 1170.0 1.1) 100000.0) ---> result: 21.3127 While AutoLISP isn't as correct as Excel. Any help to get a result like Excel is appreciated.
  9. Dear User, I have 254 Alignment sheet file, i want to make List from Alignment sheet data as following 1) Chainage with Ground Level & Some Points Crossing or TP Please see Attachment ALG Profile Data.dwg REQUIRED LIST.xlsx
  10. Hi As a small estimation routene, I would like to extract block scale values (not attributes) into a table, and into excel. My drawing is mostly created out of scaled blocks. From a selection window of items, I would like to make out a table (and export to excel) : Preview Block Name X Scale Y scale Number of items I wouldnt know if its possible, to automatically number the items in the drawing, and correspond them with the table and excel, so we can relate the item with the sheet Its an extension of Lee's Count routene, which I would like to take into excel and then do the formatting and the math to pull out some bill of materials Any suggestions ??? Thanks
  11. Hi Guys, I have an AutoLISP that creates an Excel sheet from selected table in an AutoCAD Drawing. It exports tables formed by lines and texts, also recognizing what should be merged cells. It opens a new Excel spreadsheet and fill the respective cells. Works like a charm for the job I need to do. However, It does have a flaw. It doesn't saves the generated sheet. I have to do it manually. Can you guys please help-me to complete this LISP? I Have zero programming knowledge. What I'd like it to do is to save the generated spreadsheet in the same folder as the autocad file, with the same name as the autocad file. Lilke DWG001.DWG would save a spreadsheet called DWG001.xls I'll attach my current AutoLISP file. Thanks in advance, guys. TE_TableExport_Exporta tabelas com linhas e textos para Excel.lsp
  12. Hi, I'm new around here so, I couldn't find the solutions please don't mad me if this request already written by someone else. And also sorry about my grammer either The thing what I want to do : I have a folder and this folder is include many dwg files. And these dwg files contetnts one or more layouts. I'm using Enhanced Attribute Editor for keep data like; <drawing number>, <drawing name>, <date>, <revision no> etc. So I need a lisp for export these data to an excel file . thanks in advance for any help Truly Regards
  13. I am creating an excel worksheet from autolisp to populate with all of my fuse information from autocad electrical 2011. Everything works fine except that I cannot figure out how to change the width of the columns in the excel spreadsheet from autolisp. Any assistance would be greatly appreciated. This is what I have on the spreadsheet: (setq xl (vlax-create-object "excel.application")) (setq wb-collection (vlax-get xl "workbooks")) (setq workbook (vlax-invoke-method wb-collection "add")) (setq sheets (vlax-get workbook "sheets")) (setq sheet1 (vlax-get-property sheets "item" 1)) (setq mywb(vlax-get-property xl "ActiveWorkbook")) (setq *excel-cells* (vlax-get sheet1 "cells")) (vlax-put xl "visible" 1) ;;****************insert header info into spreadsheet********************** (setq fuse_cell (strcat "A" (itoa in))) (setq cat_cell (strcat "B" (itoa in))) (setq mfg_cell (strcat "C" (itoa in))) (setq rating1_cell (strcat "D" (itoa in))) (setq class_cell (strcat "E" (itoa in))) (setq a (vlax-get-property xl 'Range fuse_cell)) (setq b (vlax-get-property xl 'Range cat_cell)) (setq c (vlax-get-property xl 'Range mfg_Cell)) (setq d (vlax-get-property xl 'Range rating1_cell)) (setq e (vlax-get-property xl 'Range class_cell)) (vlax-put-property a 'Value2 "FUSE") (vlax-put-property b 'Value2 "PART NUMBER") (vlax-put-property c 'Value2 "MANUFACTURER") (vlax-put-property d 'Value2 "RATING") (vlax-put-property E 'Value2 "CLASS") (setq in 2); sets row in spreadsheet ;*****************************populate excel sheet**************************************** (repeat (length fuse_name) (setq fuse_cell (strcat "A" (itoa in))) (setq cat_cell (strcat "B" (itoa in))) (setq mfg_cell (strcat "C" (itoa in))) (setq rating1_cell (strcat "D" (itoa in))) (setq class_cell (strcat "E" (itoa in))) (setq a (vlax-get-property xl 'Range fuse_cell)) (setq b (vlax-get-property xl 'Range cat_cell)) (setq c (vlax-get-property xl 'Range mfg_Cell)) (setq d (vlax-get-property xl 'Range rating1_cell)) (setq e (vlax-get-property xl 'Range class_cell)) (vlax-put-property a 'Value2 (nth in_lst fuse_name)) (vlax-put-property b 'Value2 (nth in_lst fuse_Cat)) (vlax-put-property c 'Value2 (nth in_lst fuse_mfg)) (vlax-put-property d 'Value2 (nth in_lst fuse_rating1)) (vlax-put-property e 'Value2 (nth in_lst fuse_class)) (setq in_lst (1+ in_lst))(princ) (setq in (1+ in))(princ) )
  14. I need to know how to save a new excel workbook to a location of my choosing. I want to be able to open a new workbook, add data, and then save it in a folder in my project folder. I can do everything but save it to the new location. This is what I have so far. (vl-load-com) (setq FilePath "T:\\reference material\\fuse_list_template.xls") (setq ExcelApp (vlax-get-or-create-object "Excel.Application")) (vla-put-visible ExcelApp :vlax-true) (vlax-put-property ExcelApp "DisplayAlerts" :vlax-false) (setq Wbk (vl-catch-all-apply 'vla-open (list (vlax-get-property ExcelApp "WorkBooks") FilePath))) From here I am adding data from autocad electrical 2011 which works fine. My problem is I want to save this to a location that is not the same as the original filepath. I cannot find the code to do a "save as" to the excel workbook. Any help would be appreciated. It should not be this complicated. Thanks.
  15. hi, my problem is that i want to get the information of a several number of Autocad files into an Excel file that i´ve already made previously(becouse in that Excel file, i have excel´s macros to work easier) , and the code that i´m going to show now, opens a new Excel and that´s what i don´t want to. I have the excel file that i want to work with, in a route like "C:\Users\Desktop\actualiza.xlsm" Thanks beforehand (if (and Dwg$lst (apply 'or (apply 'append (mapcar 'cadr Dwg$Lst)))) (progn (setq xlApp (vlax-get-or-create-object "Excel.Application") xlCells (vlax-get-property (vlax-get-property (vlax-get-property (vlax-invoke-method (vlax-get-property xlApp "Workbooks") "Add" ) "Sheets" ) "Item" 1 ) "Cells" ) )
  16. Good Afternoon, I am working on an issue at my company and I hope I can get some help. I work at a metal panel company and I was hoping that I could insert a table that will update due to panel dimensions. What I would really like to see is a table that can give me Length and Width as well as the bends associated with the panel for fastening. What would be amazing is if I could get that table to give me the aforementioned information as well as being able to account for "corner panels", etc. since that is counted as one panel in this instance. Can this all be connected to a panel number? Please let me know if this is unclear. Thank you so much!
  17. Task: Create a schedule from an excel spreadsheet. Tablestyle has been created & looks great when used with "start with empty table". The problem occurs when "create from data link" is used. The information shows up just fine & it lists as the correct tablestyle that has been created but the formatting is lost. From font, to style, to color of text & borders. All gone. Creating schedules from scratch is a typical process but with having excel schedules in place its a little different. I probably could have done them the old way by now since a solution to my problem is nowhere to be found. Note: Attachment shows the desired table style (above) and how it shows up (below) Currently running 2017 MEP in windows. Vanilla Cad is not helping either.
  18. Hello all, I have posted as a reply on other post to try and find a way to make what seems to be impossible...possible...First and foremost...I KNOW THE EXACT EQUIVALENT OF SQUAT!! about writing, reading, or understanding LISP or the verbiage associated with it. That being said, I would like to know in the most simplistic of terms, how to change the visibility state of a dynamic block using a field that is referenced from an Excel sheet. Here are the steps that I would like to take in order for what I want to accomplish to happen: open excel file input visibility state data for the block in a designated cell save the excel file open the AutoCAD dwg print (and have the block associated with the Excel input displaying the correct visibility state) I have attached a very simple block and excel sheet with this message, in the excel sheet I have copied the block information from the various visibility states using the LIST command in AutoCAD. I am currently using AutoCAD Mechanical 2018, but this block was made in AutoCAD Mechanical 2016. Here is a code that I copied from a very knowledgeable resource on LISP routines, Mr. Lee Mac, which I am sure that most of you have heard of. ;; Set Dynamic Block Visibility State - Lee Mac ;; Sets the Visibility Parameter of a Dynamic Block (if present) to a specific value (if allowed) ;; blk - [vla] VLA Dynamic Block Reference object ;; val - [str] Visibility State Parameter value ;; Returns: [str] New value of Visibility Parameter, else nil (defun LM:SetVisibilityState ( blk val / vis ) (if (and (setq vis (LM:getvisibilityparametername blk)) (member (strcase val) (mapcar 'strcase (LM:getdynpropallowedvalues blk vis))) ) (LM:setdynpropvalue blk vis val) ) ) My problem is the utterly embarrassing lack of knowledge when it comes to LISP code, so I have absolutely NO idea as to how to utilize or implement his program, what variables to change to fit my drawing or how to make it reference the field or Excel sheet. So any help would be greatly appreciated, and please, feel free to assume that you are talking to a complete idiot on the subject of LISP, because you are, and feel free to explain even OVER explain in detail the changes that I need to make in order to make this little bit of happiness work for me. Thank you in advance for all of those that have taken the time to read this, and have input to share. Thank you, Jetxcc
  19. I don't know if this is possible but have to ask. If I had an Excel spreadsheet sheet that had a list of part numbers, could I Import that into AutoCAD so that it would load premade 3d blocks where I want it to. For example I have a warehouse drawing with specific parts stored in specific locations. I have block drawings already made for each part. I have an Excel sheet with a list of part numbers. Is there a way I can import the Excel sheet and have it populate my warehouse drawing with the part drawing blocks in their perspective locations? Thanks!
  20. Hello, I've seen threads of people with similar requests. I have a different issue, I need to extract only the dimensions noted as "F.S." in the attached DWG file for each individual window. the Excel file should look like the attached image. So the method used needs to recognize the window name (A, B) and list the dimensions for the respective window in the Excel file. Any help would be very appreciated!, thank you in advance! Elevations.dwg
  21. Hi First time poster here. I've only got AutoCAD13 and there's almost no chance for us to get civil 3d. But I have a 4km pipeline i'm trying to model so I'll need a longsection. Besides doing it manually is there a more efficient method, given the contour file I have is at 0.5m intervals. I'm thinking even a script in Excel that pulls the intersect for the pipeline polyline and contour lines and return the x-y-z coordinates. Thanks
  22. Hi, Is there a way to add datalinks without doing it manually using the Data Link Manager? I need to insert a lot of data links to a CAD file and was wondering if there is a way to streamline the process. Excel Setup: In my Excel workbook, I have many worksheets and each worksheet have 2 "Named Range" to be data linked in CAD. Does anyone know how I can do this? If I had to add the data link manually, the step would be: 1) Data Link Manager > Create a new Excel Data Link 2) Choose an Excel File 3) Set Path Type: "Relative Path" 4) Select Excel sheet to link to: "Worksheet Name" 5) Link to a named range: "Named Range" 6) Uncheck "Use Excel formatting" Thanks so much!
  23. Hello.. Not familiar with autolisp or scripts I work for a earthworks company, and we are looking for a way to have an excel worksheet to update progress completion by coloring a property another colour in autocad. Example - lot 1 10% complete, and lot 10 is 30% complete as per excel data. I would like lot 1 (10%) to be light green and lot 10(30%) to be a darker green and darker shades for higher % completion and for the autocad drawing to update as the excel data sheet is updated. I have aproximatly 400 lots to program in this way if possible. Each lot will have 10 conditions (ie 10%, 20%, 30%... to 100%) Thank you
  24. Hi all! I am trying to accomplish a specific task, one that requires exporting information from CAD to excel. Fixo's DX (dimension export) LISP is a pretty good start, but I am trying to add some features to the command. Currently, the command writes the exported information vertically in columns. I am hoping to have the information run across the page in a long row. I also would like to be able to select a dimension, then select a block and have the information written to the sheet. If I don't select a dimension immediately after a dimension, I want to skip a cell in excel. See attached diagrams for the result I am after. Basically I want to select the dims and blocks down the line ... And have the output to show something like this (not requiring the headings, just the data in row 2 is enough) I would also like the command to write the information to a particular excel file, one named "Dimensions and blocks.xlsx" that sits in the folder above the current dwg file if possible. Fixo's currently writes to a new blank workbook each time the command is run. Thanks all for the help!
  25. Hi all:D, I have a huge request linked to an lisp received from a friend. Lisp do next operation ... select a file type PRN (Ex 1.PRN), required datum level (ex:90) value and automatically draws longitudinal profile with data from file PRN (formatted text space delimited) . my request is ... can someone help me to do lisp advanced form of longitudinal profile as shown in attached “LGTR.dwg” file(in green rectangle). When I upload file 2.prn in lisp drawing the result from the green box. I would appreciate if someone can suggest an idea or if modify the Lisp as showing the longitudinal profile in green border. to use prn file please del .txt lisp command is LGTR datum level for my files is 90 Thank you for your time. LGTR.dwg LGTR.LSP 1.prn.txt 2.prn.txt
  • Create New...