Jump to content

Recommended Posts

Posted (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.

 

 

 

 

 

Capture.JPG

Edited by hosyn
Posted

Your now up to 300+ posts its time to do it yourself, you should be starting to know how by now.

Posted (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 by Lee Mac
  • Thanks 1
Posted

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

 

  • Thanks 1
Posted

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 !!!

Posted

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..

 

 

 

 

  • Like 1
Posted

Also this and fixed 3 errors you had 2 brackets at end and wrong filename.


 

(setq fname (STRCAT PATHF DWGNNNN "---" AAA ".TXT" ) "w")
)

 

  • Thanks 1
Posted (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 by hosyn
Posted

Look at

 

VL-FILE-COPY
VL-FILE-DELETE
VL-FILE-DIRECTORY-P
VL-FILE-RENAME

  • Thanks 1
Posted (edited)

THANK YOU ALL , EVERYTHING BEING OKEY,😍

Is there anyway to export this information of dwg to SQLLIGHT. Anyone here have that experience ??

Edited by hosyn
Posted (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 by pBe

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...