hosyn Posted June 21, 2020 Posted June 21, 2020 (edited) Hello guys I need code lisp to create a empty file text in current folder as the following pic: 1-GET INPUT TEXT LIKE "AAA" 2-CREATE EMPTY TEXT FILE thank you in advance for any helping. Edited June 21, 2020 by hosyn Quote
BIGAL Posted June 21, 2020 Posted June 21, 2020 Your now up to 300+ posts its time to do it yourself, you should be starting to know how by now. Quote
Lee Mac Posted June 21, 2020 Posted June 21, 2020 (edited) Prompt the user for a string using the getstring function Obtain the path of the current drawing using the DWGPREFIX system variable Obtain the drawing filename using the DWGNAME system variable Obtain the value of these system variables using the getvar function Obtain the filename without the extension using the vl-filename-base function Concatenate the filepath, filename, "---", user string, and ".txt" extension using the strcat function Create the text file using the open function with the "w" argument (to open for writing) Close the text file using the close function Edited June 21, 2020 by Lee Mac 1 Quote
pBe Posted June 21, 2020 Posted June 21, 2020 continued... Obtain the knowledge by posting in CADTutor AutoLISP, Visual LISP & DCL At least put an effort to write a code and asked for advice / suggestions when you hit a wall. [ The best way to learn ] Search the forum for similar topic first before posting a request. Avoid starting a new topic when things does'nt go your way on an un-resolved issue from another topic that you started 1 Quote
hosyn Posted June 22, 2020 Author Posted June 22, 2020 HI TO ALL APPRECIATE FOR ALWAYS AIDED, I LIKE YOU ALL SO MUCH. I TRIED TO CREATE TILL (defun c:crytxt(/) (vl-load-com) (setq AAA (getstRING "tell ---AAA")) ;;;Prompt the user for a string using the getstring function (setq PATHF (getvar "dwgprefix")) ;;;Obtain the path of the current drawing using the DWGPREFIX system variable (setq DWGN (getvar "dwgNAME" )) ;;;Obtain the drawing filename using the DWGNAME system variable ;;;Obtain the value of these system variables using the getvar function (setq DWGNNN (vl-filename-base DWGN)) ;;;Obtain the filename without the extension using the vl-filename-base function (STRCAT PSTHF DWGN "---" AAA ".TXT" );;;Concatenate the filepath, filename, "---", user string, and ".txt" extension using the strcat function )) ANY RECOMAND !!! Quote
pBe Posted June 22, 2020 Posted June 22, 2020 if you're wondering why it showing the error. ; error: bad argument type: stringp nil ... you mispelled one variable at your strcat statment and you are almost there.. 1 Quote
BIGAL Posted June 23, 2020 Posted June 23, 2020 Also this and fixed 3 errors you had 2 brackets at end and wrong filename. (setq fname (STRCAT PATHF DWGNNNN "---" AAA ".TXT" ) "w") ) 1 Quote
hosyn Posted June 23, 2020 Author Posted June 23, 2020 (edited) Thank you to all with your guide this issue solved perfectly ' NOW IN CONTINUE IF I WANT TO SEARCH DWG AND TXT RELATED TOGATHER AND RENAMINIG ALL SAME AS (*******.DWG) FILE WITH (******-AAA.TXT) .WHAT YOU RECOMMEND ME. Edited June 23, 2020 by hosyn Quote
BIGAL Posted June 24, 2020 Posted June 24, 2020 Look at VL-FILE-COPY VL-FILE-DELETE VL-FILE-DIRECTORY-P VL-FILE-RENAME 1 Quote
hosyn Posted June 25, 2020 Author Posted June 25, 2020 (edited) THANK YOU ALL , EVERYTHING BEING OKEY, Is there anyway to export this information of dwg to SQLLIGHT. Anyone here have that experience ?? Edited June 25, 2020 by hosyn Quote
pBe Posted June 25, 2020 Posted June 25, 2020 (edited) 8 hours ago, hosyn said: Is there anyway to export this information of dwg to SQLLIGHT. Anyone here have that experience ?? Sounded like a light alcoholic beverage to me, in that case Yes I do have expererience. but i'm sure we are NOT referring to the same thing - - - PLEASE DRINK RESPONSIBLY - - - Edited June 25, 2020 by pBe Quote
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.