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. I've found a number of articles outlining the process of extracting data from AutoCAD to an Excel file, but I'm wondering if it's possible to do the reverse. For my work I have a number of databased already established in Excel and am able to create information tables rather quickly that access these databases. Currently, after creating a table in Excel I then copy, paste, scale to the right size in AutoCAD. There's gotta be a way to create a table in AutoCAD that simply accesses this information in Excel and just updates automatically. I produce a number of CAD drawings off of a template daily so this process has become quite the bottleneck. I really appreciate any help!
  2. Hello, I am designing a RCC Dam and the shape of the dam is constant and will not change, but the dimensions of this shape are very likely to change depending upon hydraulic analysis. I have written a program (irrelevant, but I am using MathCad 14) that performs a stability analysis of a RCC Dam (based on elevations from the hydraulic analysis) and then exports the dam dimensions and coordinates to Excel. I am attempting to then take those coordinates (or dimensions) from Excel to create a 2-D dimensioned drawing of the Dam in AutoCAD. I have successfully linked the Excel spreadsheet containing these coordinates and dimensions to AutoCad tables in my drawing, but I am having trouble getting AutoCAD to update my drawing as these tables update with different coordinates and dimensions. I would like to have a drawing that is fully dimensioned (as the shape of the dam will not change), but that will update coordinates and dimensions as I pump out different dam dimensions from my stability analysis. Hope this makes sense, let me know if anything is unclear. Thanks!, Sublett
  3. I want to link an excel sheet with a drawing, so changing the excel changes the drawing. I used this awesome site to learn about going to Edit->Paste Special->Paste Link->AutoCAD Entities...but I don't have that choice. Just the one that makes the OLE image. While that will work, that is less than ideal. Know any reason that wouldn't appear? It appears in just normal paste, but not under paste link. AutoCAD 2007, A.54; Excel 2003 SP3; Windows XP SP3.
  4. I have read many posts about linking attributes with excel files but have yet been able to receive any help with what i'm trying to do, so any input would be greatly appreciated. I'm an engineer that works for a company that designs offshore drilling platforms. Currently i am generating panel termination sheets (image attached) and i have to generate one for every junction box but i have several to do (several 100). What i want to do is link my excel junction box schedule (image attached) and set up my attributes in such a way that i input the originating or terminating device and the rest of the attributes auto populate based on my excel sheet. For example (view attached image as reference), i want to input "s-t4630", then i want my cable size (3x2.5mm2), and my cable id (t46-el-2005-01) to generate. REFERENCE IMAGES.zip
  5. Hello there :-) I am wondering whether anyone may be able to provide a relative newbie with some assistance. I have been trawling the pages here and elsewhere to try and find an answer that I can comprehend or use, but had no luck so far :-( What I am trying to achieve, is to import an excel spreadsheet to AutoCad 2010, and use cells from this table to automatically populate text fields. What I am trying to generate are some 19" patch bay labels (that can only be printed on A3 at an angle, hence the use of cad). We have to create these types of labels a lot, and Excel is a far more friendly place to be able to do this (plus the data already exists from wiring schedules). I have not tried any form of automation like this before, so am not really sure where to start. The searches I have made are probably failing, as I don't know what to call the thing I am looking for. I have managed to copy and "paste special" as an object the table that I wish to use - however I cannot seem to find a way to replicate the data from the table to the areas on the drawing where the text needs to appear. I did try the insert field/formula/cell - but I of course only get #### as the fields are text rather than numerical (well a mix of both). Does anyone know if there is a solution to being able to complete this task please? It takes a long time to go through and manually change all of the separate mtext blocks as there are 2 off rows of 48 per patch bay, and each pair of patches uses 3 separate text inputs. Todays job has a total of 13 patch bays, so any form of automation from the existing excel sheets would make me a very happy man... Any assistance very much appreciated, Kind Regards, Lee Rich
  6. Hi, I'm attempting to modify Fixo's code at bottom to read data from an excel spreadsheet that's formatted a bit differently than assumed by the code. The code here assumes X, Y, and Z scale each live in a separate exel column/cell. However, I have existing spreadsheets where these dimensions were entered as a text string in a single cell. For example, the cell might read 6x5.5x24. The only constant is the "x" between the dimensions. The text numbers might be one, two or even three characters and may or may not include decimals. My thought is to modify these lines below to somehow check the same string for the X's and truncate according its position to extract the desired X, Y or Z value. But, I don't know enough yet to even know if this is possible. xscale (atof (vl-princ-to-string (nth 5 item))) yscale (atof (vl-princ-to-string (nth 6 item))) zscale (atof (vl-princ-to-string (nth 7 item))) Failing this, I'll make a second version of the existing spreadsheets and have users copy data into new columns formatted to work with the existing code. Many thanks! ;;;---------------------------------------------------------------------------; ;;; ;;; getexel.lsp ;;; ;;; based on code posted by "fixo" on [url]http://forums.augi.com/showthread.php?t=112689&highlight=blocks+excel[/url] ;;; This lisp is used to insert a block multiple times based on coordinates and scale factors listed in an excel spreadsheet ;;; Data in spreadsheet must follow this format: ;;; first row is headers/labels for data ;;; cola-empty, colb-x coord, colc-y coord, cold-z coord, colf-width/x scale, colg-depth/y scale, colh-height/z scale, ;;; coli-layer destination name, colj-equip tag number. ;;; ;;;---------------------------------------------------------------------------; ;;; ;;; DESCRIPTION ;;; ;;; Configure AutoCAD ;;; ;;;****************************************************** ;;; Section 1 ;;;****************************************************** ;;; ;;; --- Load Visual Lisp Support ;;; (VL-LOAD-COM) ;;;****************************************************** ;;; Section 2 ;;;****************************************************** ;;; read used range from Excel ;;; (defun getexcelinfo (Wbk ShtNum / Sht UsdRange ExcData) (setq Sht (vl-catch-all-apply 'vlax-get-property (list (vlax-get-property Wbk "Sheets") "Item" ShtNum ) ) ) (setq UsdRange (vlax-get-property Sht "UsedRange") ExcData (vlax-safearray->list (vlax-variant-value (vlax-get-property UsdRange "Value") ) ) ) (setq ExcData (mapcar (function (lambda (x) (mapcar 'vlax-variant-value x))) ExcData ) ) ExcData ) ;;;****************************************************** ;;; Section 3 ;;;****************************************************** (defun C:getexcel (/ *error* acsp adoc aexc att1 att2 att3 att4 attribs block_data blockname block_obj dwgpath layer rot x xlbook xlbooks xlpath xscale y yscale z zscale) (defun *error* (msg) (vl-bt) (if (vl-position msg '("console break" "Function cancelled" "quit / exit abort" ) ) (princ "Error!") (princ msg)) (vla-endundomark adoc) (vl-exit-with-value "Program bombed, sorry") ) (if (setq xlpath (getfiled "* Select Excel File To Read Data*" "" "xlsx" 4) ) (progn (setq aexc (vlax-get-or-create-object "Excel.Application") xlbooks (vlax-get-property aexc "Workbooks")) (setq xlbook (vlax-invoke-method xlbooks "Open" xlpath)) (setq block_data (getexcelinfo xlbook 1));<-- 1 is excel sheet number, change to suit (setq block_data (vl-remove-if-not (function (lambda (x) (car x))) block_data)) (setq block_data (cdr block_data)) (vl-catch-all-apply (function (lambda () (vlax-invoke-method xlbook "Close" :vlax-false))) ) (mapcar (function (lambda (x) (vl-catch-all-apply (function (lambda () (progn (if x (vlax-release-object x))))))) ) (list xlbook xlbooks aexc) ) (setq aexc nil) (gc) (gc) (setq dwgpath (getfiled "* Select Drawing With Block To Insert *" "" "dwg" 4) ) (setq blockname (vl-filename-base dwgpath)) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (setq acsp (vla-get-block (vla-get-activelayout adoc))) (vla-startundomark adoc) (vl-catch-all-apply (function (lambda () (progn (setq block_obj (vlax-invoke-method acsp 'InsertBlock (vlax-3d-point '(0 0 0)) dwgpath 1 1 1 0 ) ) (vla-delete block_obj) (vlax-release-object block_obj)))) ) ;; I know nothing what is data format in your Excel ;; thus I have added extrafluous convertion of them (foreach item block_data (setq x (atof (vl-princ-to-string (nth 1 item))) y (atof (vl-princ-to-string (nth 2 item))) z (atof (vl-princ-to-string (nth 3 item))) rot (atof (vl-princ-to-string (nth 4 item))) xscale (atof (vl-princ-to-string (nth 5 item))) yscale (atof (vl-princ-to-string (nth 6 item))) zscale (atof (vl-princ-to-string (nth 7 item))) layer (vl-princ-to-string (nth 8 item)) att1 (vl-princ-to-string (nth 9 item)) att2 (vl-princ-to-string (nth 5 item)) att3 (vl-princ-to-string (nth 6 item)) att4 (vl-princ-to-string (nth 7 item)) ) (setq block_obj (vlax-invoke-method acsp 'InsertBlock (vlax-3d-point (list x y z)) dwgpath xscale yscale zscale rot) ) (if (tblsearch "layer" layer) (vla-put-layer block_obj layer) (princ (strcat "\nLayer " "\"" layer "\"" " does not exist")) ) (setq attribs (vlax-invoke block_obj 'GetAttributes)) (foreach att attribs (cond ((eq "EQ-TAG" (vla-get-tagstring att));<--"EQ-TAG" is the first tag (vla-put-textstring att att1)) ((eq "EQ-WIDTH" (vla-get-tagstring att));<--"EQ-WIDTH" is the second tag (vla-put-textstring att att2)) ((eq "EQ-DEPTH" (vla-get-tagstring att));<--"EQ-DEPTH" is the THIRD tag (vla-put-textstring att att3)) ((eq "EQ-HGHT" (vla-get-tagstring att));<--"EQ-HGHT" is the FOURTH tag (vla-put-textstring att att4)) ;<-- add other tags here by the same way as above (T nil) ) ) ) ) ) (*error* nil) (prin1) ) (prompt "\n\t\t>>>\tType getexcel to execute\t<<<") (prin1) (vl-load-com)~'J'~
  • Create New...