zoom108 Posted May 3, 2016 Share Posted May 3, 2016 Hello, So a simple question for the right person. I utilize Al's Steel Mill heavily in my detailing job and would like to edit one of the functions of the LISP routine. Instead of the function reading dimensions and drawing 3D shapes, I want to change it to read the dimension information and instead just translate it to a MTEXT field that I can paste into my drawing. Another way could just be to create another simple LISP and read information from another .dim file. Ultimately I'm looking for a text printout of Name, Depth, and Width Information. Any help is appreciated. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 4, 2016 Share Posted May 4, 2016 Need more info for us that do not use Al's steel mill, in particular post a .dim file. Quote Link to comment Share on other sites More sharing options...
zoom108 Posted May 4, 2016 Author Share Posted May 4, 2016 I've attached the LSP and DCL files. Again though, if it would be simpler how could I just read a line from the Stl_W.dim file and convert it to MTEXT? David lisp fiels.zip Quote Link to comment Share on other sites More sharing options...
BKT Posted May 5, 2016 Share Posted May 5, 2016 If you just want to get a line from the DIM file in as MTEXT, you could try this: (disclaimer - works in BricsCAD) Open the file (I used Notepad) and then highlight the line, copy and paste it into AutoCAD. It should come in as MTEXT. For that matter, you could select all and copy/paste into AutoCAD as MTEXT but it would be a LOT of lines. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 5, 2016 Share Posted May 5, 2016 Same in Autocad Mtext open window and paste. Its a big job just finding the right spot in the code to add on your request. Quote Link to comment Share on other sites More sharing options...
zoom108 Posted May 5, 2016 Author Share Posted May 5, 2016 The idea is to use a command to quickly import information from the table regarding one steel piece. NAME: W10X12 DEPTH: 9.87 DET DEPTH: 9-7/8" WEB THK: 3/16" FLANGE THK: 3/16" F GUAGE: 2-1/4" W GUAGE: 8-3/8" I'm not looking for someone to create all of it, but as a non-programmer some help in the initial command line to pull say the name from that dim file would be all I need to get started. I get that copy and paste would be a solution but the goal is to automate and not have to have other documents look through tables of other extra information. David Quote Link to comment Share on other sites More sharing options...
BKT Posted May 5, 2016 Share Posted May 5, 2016 Have you contacted Al? I see he has his contact info in the LSP. Might want to check with him about modifying this code. I see that he combined some other code to get this done, but seeing a copyright notice always makes me nervous... If there's no problem with Al, one thing you could try is building a separate LSP to OPEN and READ-LINE the .DIM file. AfraLISP has a good walk-through on how to do this: http://www.afralisp.net/autolisp/tutorials/file-handling.php Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 6, 2016 Share Posted May 6, 2016 (edited) Als steel mill has lots of DIM files so need a pick right one using "findfile" but here is a start using a filename. (defun dosome () (Princ "do your thing") ; close file do text and then use (exit) ) (setq component (getstring "enter name of component")) (setq fo (open (setq fname "C:\\acadtemp\\Stl_W.dim") "R")) (while (setq newline (read-line fo)) (if (/= (VL-STRING-SEARCH component Newline ) NIL) (dosome) ; do your thing here (Princ "\nmissed") ) ) (close fo)(close fo) Edited May 6, 2016 by BIGAL 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.