jobube Posted February 8, 2019 Share Posted February 8, 2019 Hi all, I'am new here so sorry if i put this in wrong topic. I need help with some work. I have excel table with X and Y dimensions of 6000 parts with different text on each part. So now i would like to link excel file to AutoCad or SolidWorks to get dwg or dxf from it in one go? Is it possible and if so can you help me? Quote Link to comment Share on other sites More sharing options...
CyberAngel Posted February 8, 2019 Share Posted February 8, 2019 Are these 6000 parts all the same part? Are they all oriented the same way? If not, does the spreadsheet contain the angle for each part? I don't know exactly how you would do this. Some versions import points from a spreadsheet. With a little programming, you may be able to insert blocks at the locations you specify with an attribute that contains the proper text. Quote Link to comment Share on other sites More sharing options...
jobube Posted February 9, 2019 Author Share Posted February 9, 2019 CyberAngel 1st thanks for reply. They are not same part. But they look alike. They are oriented the same way. They are like 18*150 with text on them. Small text like 6-7 words. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 10, 2019 Share Posted February 10, 2019 Admin probably move to Lisp area etc You need to explain a bit more what it is you are exactly trying to achieve is it to create a single dwg, insert a block, or amend existing dwgs. There is lots of stuff out there about Excel <-> Autocad its a case of generally what is to happen on the Autocad side. Quote Link to comment Share on other sites More sharing options...
jobube Posted February 10, 2019 Author Share Posted February 10, 2019 Thx for reply, I need to make single dwg or dxf for each part. Simple Example: Board 17x125mm with Text on it.. 6-7 Words. I have like 2200 parts all with same size 17x125 mm and every single one has a different text. So i want to link text from excel with autocad to get each dwg or dxf file for each different part. So i can use em for CNC procesing. I still have more parts to do but with different size.. (19x150mm, 25x100 mm..) and every single part have different text. Total job is like : 2200 parts 17x125 mm with different texts 1500 parts 19x150 mm with different texts 1000 parts 25x100 mm with different texts 1300 parts all different size and with different texts Quote Link to comment Share on other sites More sharing options...
maratovich Posted February 10, 2019 Share Posted February 10, 2019 1. Attach the sample files. 2. Is this a one-time job? 3. I think this is just the beginning. 4. It may be necessary to continue with a different style and other parameters of the test, location, and more ... Quote Link to comment Share on other sites More sharing options...
jobube Posted February 10, 2019 Author Share Posted February 10, 2019 Pdf file is exemple of boards. Excel is just a small part of total job. You can see text detail and board size (mm). SB 65832 PLOCICE NATPISNE.PDF 02.448.430DALJINSKI ventili-natpisne plocice.xlsx Quote Link to comment Share on other sites More sharing options...
steven-g Posted February 10, 2019 Share Posted February 10, 2019 Looking at your pdf it shows the text in different positions/groups sometimes split up in two lines, and at different distances and heights. How do you know from the excel information how this translates to the layout on the labels. I see the plate size in excel but no identification as to how the text in column "F" is divided and placed onto the labels. The excel list and pdf are also not the same items. A dwg showing the results from the excel list might make it clearer. Or a break down of how the information in excel translates to the placement in dwg. Quote Link to comment Share on other sites More sharing options...
jobube Posted February 10, 2019 Author Share Posted February 10, 2019 Hi, thx for reply. Yes the pdf and excel are not same parts. Pdf is exemple as i told you on previous post. For excel parts text must be on center of the board.. Sorry if i missinform you. Quote Link to comment Share on other sites More sharing options...
steven-g Posted February 10, 2019 Share Posted February 10, 2019 Not misinformation but as an example is the first item in the excel sheet, in column "f" which reads "Butterfly valve LUG ND250 PN10 SM Fig.711901 - EL-PNE ACT MVS190" Is that what needs placing on the labels or is it just "EL-PNE ACT MVS190" or something else. And does that text start at 15mm from the edge and is 10mm high. Because at 10mm high "EL-PNE ACT MVS190" in standard text would be about 140mm wide and won't fit. Quote Link to comment Share on other sites More sharing options...
jobube Posted February 10, 2019 Author Share Posted February 10, 2019 Name of plate is under: "NamePlateDesc" Text need to be centered on plate. No need for spacing from edge Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 10, 2019 Share Posted February 10, 2019 Looking at the pdf and the excel there does not seem to be any real link between the two, the excel does not have a key to link the plate style. Need a dwg with the correct xls, so can try to work out whats going on. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted February 11, 2019 Share Posted February 11, 2019 I moved your thread to the AutoLISP, Visual LISP & DCL Forum. Quote Link to comment Share on other sites More sharing options...
steven-g Posted February 11, 2019 Share Posted February 11, 2019 To use the example select the yellow colored cells in excel and press Crt+c then in Autocad make the command line active by clicking on it and make sure the cursor is blinking inside the command line or this won't work, then press Ctrl+v. Below is a description of what's going on. Heres an example of using excel directly to create the files, you will notice a few "helper" formulas to split some of the earlier cells into useful data, ie. the width and height of the plates, and another formula to work out the height of the text based on the number of characters in the text item itself. The text command is a bit of an oddity when you are using it from excel so you need to split the input data up so there are lines in between to get the formulas to work properly, I'd use VBA to do that but it's fairly quick just to insert 2 lines each time, or do a search for adding blank lines between data rows on google there are a few simple tricks for doing that. Then the three formulas in column "N" starting at row 4 the first one is used to empty the drawing area, draw a rectangle and use the same measurements to place text at the center of the rectangle, it needs a new row to finish the text command properly, and the second and third formula's now save the drawing using the text in column A as a drawing name. The first 2 rows set up a folder where all your drawings will be saved to, so change that to suit (filedia=0 is needed to stop any prompts for filenames, and this is reset at the very last row). So if you use this make sure that is moved to the last cell. I only did the first four items, I'll leave it to you split the rest of the data and copy/paste the formulas, The helper formulas should cover most size of box but just be aware that if you get beyond 2 or 3 figure numbers it will need adapting (or if you use decimal places). 02.448.430DALJINSKI ventili-natpisne plocice.xlsx Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 12, 2019 Share Posted February 12, 2019 (edited) Nice Steven-g had a quick look but still a big job if the end result is to do all the dims. One gotcha the text style needs to have height set to 0.0 say "Standard", the dwg brg mine is set to north up so text appears 90. Changed both works now. Still think its a pay for sort of job just bring in the range from excel so can do multiple items per sheet. Again needs a style column, single panel, double row text, there is about 6 styles in the pdf. Dynamic blocks come to mind as that removes the need for lots of coding. Makes sense maybe a tick a box approach is the part required. Edited February 12, 2019 by BIGAL Quote Link to comment Share on other sites More sharing options...
steven-g Posted February 12, 2019 Share Posted February 12, 2019 Hi Bigal Definitely only an example, and does need changing for things like text style, but if you have 6000 of these to do, it's worth spending a few hours on coding to get it all sorted. I do similar things for customers who have repetitive work, purely in VBA, the VBA writes out a script file which is easier than all those formulas and formatting. Then all you need do is press a button in Autocad and watch it churn out drawings. Quote Link to comment Share on other sites More sharing options...
jobube Posted February 12, 2019 Author Share Posted February 12, 2019 Hi, Thx a lot for example. I will try my best to apply this for my work. Will give back the info after I try it! Thx once more! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 13, 2019 Share Posted February 13, 2019 Hi Steven-g going down the vba to script makes a lot of sense same with a lisp <-> excel. Jojube had a bit more of a think have you looked at using blocks this way all the dims are filled in but again your excel must say which block to use, then like steven-g you could have a macro that writes the correct info depending on the block type. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.