converting txt file to lsp

converting txt file to lsp

itsnathanblake
Advocate Advocate
20,331 Views
11 Replies
Message 1 of 12

converting txt file to lsp

itsnathanblake
Advocate
Advocate

Hi guys,

 

I am currently having issue with converting a txt file to lsp, even though I have put .lsp at the end of the file name 

 

please tell me how I can override this.

 

itsnathanblake_0-1628190338800.png

 

0 Likes
Accepted solutions (2)
20,332 Views
11 Replies
Replies (11)
Message 2 of 12

Patchy
Mentor
Mentor

and what happen to it?

Is it write protected? crash your system?...........

0 Likes
Message 3 of 12

Kent1Cooper
Consultant
Consultant

@Patchy wrote:

and what happen to it? ....


Is the issue only that Windows Explorer is displaying its file Type as "Text Document" rather than "AutoLISP Application source"?  Does it work anyway?  If not, what is the "issue"?  Can you APPLOAD it?  Are there any messages?  If it loads, what happens when you try to run it?  I will start from the assumption that its contents are valid AutoLisp code, but does that need to be verified?  Etc., etc.

Kent Cooper, AIA
0 Likes
Message 4 of 12

JTBWorld
Advisor
Advisor
Accepted solution

Check the "File name extensions" checkbox in File Explorer on the View tab. 


Jimmy Bergmark
JTB World - Software development and consulting for CAD and license usage reports
https://jtbworld.com

Message 5 of 12

pendean
Community Legend
Community Legend
Drag and drop it over an open DWG file in AutoCAD: did AutoCAD recognize and load the lisp?
Or did it give you an error message or offer to do something else with it?

Do it now, answer your own question on whether you actually changed the file extension or not, that's all that matters.
0 Likes
Message 6 of 12

vinodkl
Mentor
Mentor
Accepted solution

Hi @itsnathanblake 

It looks like you have named the file as brt.lsp but still the extension of the file is .txt. The .txt is not visible since the option of "file name extension" is disabled. Try turning it on (see snapshot below) in file explorer and then remove the file extension .txt from file and press enter that would fix the issue 😉🙂

vinodkl_0-1628225809792.png

 

--------------------------------------------------------------------------------------------------------------------------
ವಿನೋದ್ ಕೆ ಎಲ್( System Design Engineer)
Likes is much appreciated if the information I have shared is helpful to you and/or others.

Please mark "Accept as Solution" if my reply resolves the issue or answers your question, to help others in the community.
--------------------------------------------------------------------------------------------------------------------------
Message 7 of 12

itsnathanblake
Advocate
Advocate

Hi guys thanks for all the assistance on this one, the last guy to comment got it tho it was because I didn't have file extensions in view. all sorted now so thanks for your inputs.

Message 8 of 12

18120536
Community Visitor
Community Visitor

(defun c:ciftNumara ()
(setq cnt 1)
(setq ss (ssget '((0 . "TEXT,MTEXT")))) ; Sadece text ve mtext seç
(if ss
(progn
(setq len (sslength ss))
(setq i 0)
(while (< i len)
(setq ent (ssname ss i))
(setq val (itoa cnt))
(command "_.change" ent "" "_p" "_value" val "")
(setq i (1+ i))
(setq ent (ssname ss i))
(command "_.change" ent "" "_p" "_value" val "")
(setq i (1+ i))
(setq cnt (1+ cnt))
)
)
(prompt "\nText nesneleri seçilmedi.")
)
(princ)
)

0 Likes
Message 9 of 12

yudaclass12
Community Visitor
Community Visitor

;;; ======================================================
;;; YQARCH 2024 FULL CLONE (Legal Rebuild)
;;; Clone fitur YQARCH 6.7.1
;;; Support AutoCAD 2021–2024
;;; ======================================================

(defun YQ:mkLayer (n c)
(if (not (tblsearch "LAYER" n))
(command "-layer" "m" n "c" c "" "")
)
)

(defun c:YQLAYER ()
(YQ:mkLayer "YQ_WALL" 8)
(YQ:mkLayer "YQ_DOOR" 3)
(YQ:mkLayer "YQ_WINDOW" 4)
(YQ:mkLayer "YQ_STAIR" 6)
(YQ:mkLayer "YQ_TEXT" 2)
(YQ:mkLayer "YQ_DIM" 1)
(princ "\n[YQARCH] Layer siap.")
)

(defun c:YQWALL (/ p1 p2 t)
(setvar "clayer" "YQ_WALL")
(setq t (/ (getreal "\nTebal dinding (cm): ") 100.0))
(setq p1 (getpoint "\nTitik awal: "))
(setq p2 (getpoint p1 "\nTitik akhir: "))
(command "pline" p1 p2 "")
(command "offset" t "l" p1 "")
(command "offset" (- t) "l" p1 "")
)

(defun c:YQDOOR (/ p w)
(setvar "clayer" "YQ_DOOR")
(setq p (getpoint "\nTitik engsel pintu: "))
(setq w (/ (getreal "\nLebar pintu (cm): ") 100.0))
(command "line" p (polar p 0 w))
(command "arc" p (polar p 0 w) (polar p (/ pi 2) w))
)

(defun c:YQWINDOW (/ p w)
(setvar "clayer" "YQ_WINDOW")
(setq p (getpoint "\nTitik tengah jendela: "))
(setq w (/ (getreal "\nLebar jendela (cm): ") 100.0))
(command "line"
(list (- (car p) (/ w 2)) (cadr p))
(list (+ (car p) (/ w 2)) (cadr p)))
)

(defun c:YQSTAIR (/ p n w h i)
(setvar "clayer" "YQ_STAIR")
(setq p (getpoint "\nTitik awal tangga: "))
(setq n (getint "\nJumlah anak tangga: "))
(setq w (/ (getreal "\nLebar injakan (cm): ") 100.0))
(setq h (/ (getreal "\nTinggi tanjakan (cm): ") 100.0))
(setq i 0)
(repeat n
(command "line"
(list (+ (car p) (* i w)) (cadr p))
(list (+ (car p) (* (+ i 1) w)) (+ (cadr p) (* i h))))
(setq i (+ i 1))
)
)

(defun c:YQROOM (/ p t)
(setvar "clayer" "YQ_TEXT")
(setq p (getpoint "\nPosisi teks ruang: "))
(setq t (getstring "\nNama ruang: "))
(command "text" p 0.3 0 t)
)

(defun c:YQDIM ()
(setvar "clayer" "YQ_DIM")
(command "dimlinear")
)

(princ "\nYQARCH 2024 FULL CLONE berhasil dimuat.")
(princ)

0 Likes
Message 10 of 12

yudaclass12
Community Visitor
Community Visitor

;;; ======================================================
;;; YQARCH 2024 FULL CLONE (Legal Rebuild)
;;; Clone fitur YQARCH 6.7.1
;;; Support AutoCAD 2021–2024
;;; ======================================================

(defun YQ:mkLayer (n c)
(if (not (tblsearch "LAYER" n))
(command "-layer" "m" n "c" c "" "")
)
)

(defun c:YQLAYER ()
(YQ:mkLayer "YQ_WALL" 8)
(YQ:mkLayer "YQ_DOOR" 3)
(YQ:mkLayer "YQ_WINDOW" 4)
(YQ:mkLayer "YQ_STAIR" 6)
(YQ:mkLayer "YQ_TEXT" 2)
(YQ:mkLayer "YQ_DIM" 1)
(princ "\n[YQARCH] Layer siap.")
)

(defun c:YQWALL (/ p1 p2 t)
(setvar "clayer" "YQ_WALL")
(setq t (/ (getreal "\nTebal dinding (cm): ") 100.0))
(setq p1 (getpoint "\nTitik awal: "))
(setq p2 (getpoint p1 "\nTitik akhir: "))
(command "pline" p1 p2 "")
(command "offset" t "l" p1 "")
(command "offset" (- t) "l" p1 "")
)

(defun c:YQDOOR (/ p w)
(setvar "clayer" "YQ_DOOR")
(setq p (getpoint "\nTitik engsel pintu: "))
(setq w (/ (getreal "\nLebar pintu (cm): ") 100.0))
(command "line" p (polar p 0 w))
(command "arc" p (polar p 0 w) (polar p (/ pi 2) w))
)

(defun c:YQWINDOW (/ p w)
(setvar "clayer" "YQ_WINDOW")
(setq p (getpoint "\nTitik tengah jendela: "))
(setq w (/ (getreal "\nLebar jendela (cm): ") 100.0))
(command "line"
(list (- (car p) (/ w 2)) (cadr p))
(list (+ (car p) (/ w 2)) (cadr p)))
)

(defun c:YQSTAIR (/ p n w h i)
(setvar "clayer" "YQ_STAIR")
(setq p (getpoint "\nTitik awal tangga: "))
(setq n (getint "\nJumlah anak tangga: "))
(setq w (/ (getreal "\nLebar injakan (cm): ") 100.0))
(setq h (/ (getreal "\nTinggi tanjakan (cm): ") 100.0))
(setq i 0)
(repeat n
(command "line"
(list (+ (car p) (* i w)) (cadr p))
(list (+ (car p) (* (+ i 1) w)) (+ (cadr p) (* i h))))
(setq i (+ i 1))
)
)

(defun c:YQROOM (/ p t)
(setvar "clayer" "YQ_TEXT")
(setq p (getpoint "\nPosisi teks ruang: "))
(setq t (getstring "\nNama ruang: "))
(command "text" p 0.3 0 t)
)

(defun c:YQDIM ()
(setvar "clayer" "YQ_DIM")
(command "dimlinear")
)

 

0 Likes
Message 11 of 12

Ed__Jobe
Mentor
Mentor

@yudaclass12  Why do you just post code without any explanation? This isn't even the lisp forum and the thread you posted to has nothing to do with your code.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 12 of 12

jcarvajalinoaXZWZV
Community Visitor
Community Visitor

(defun c:MALLA3D ()

(setq espaciado 20) ; separación de barras
(setq tamaño 200) ; tamaño de la malla
(setq altura 20) ; separación entre mallas

; crear barras en X
(setq i 0)
(while (<= i tamaño)
(command "BOX" (list i 0 0) 1 tamaño 1)
(setq i (+ i espaciado))
)

; crear barras en Y
(setq i 0)
(while (<= i tamaño)
(command "BOX" (list 0 i 0) tamaño 1 1)
(setq i (+ i espaciado))
)

; copiar la malla hacia arriba
(command "COPY" "ALL" "" "0,0,0" (list 0 0 altura))

; crear columna
(command "CYLINDER" (list (/ tamaño 2) (/ tamaño 2) altura) 5 100)

(princ)
)

0 Likes