Remove the .dwg from value returned via DwgName
I often run a program that asks for the directory and then the name of the drawing and then combine them together.
(princ)
(setq FILE nil)
(setq PREFIX (getvar "dwgprefix"))
(setq DNAME (getvar "dwgname"))
(setq FNAME (strcat PREFIX DNAME ".DAT"))
Is there a way I can drop the .dwg from "dwgname" since I really want to make a .dat file?
Thanks,
Beth
RE: The darn drawing name
Code:
(vl-filename-base (getvar "dwgname"))
or
Code:
(setq Str (getvar "dwgname"))
(setq Str (substr Str 1 (- (strlen Str) 4)))
RE: The darn drawing name
Thank you very much!
Beth
RE: The darn drawing name
RE: Remove the .dwg from value returned via DwgName
Quote:
Originally Posted by thomas.krueger
. . . fnsplitl is undocumented. . .
Great Thomas, do you have more undocumented candy ?
: ) Happy Computing !
kennet
RE: Remove the .dwg from value returned via DwgName
Hi kennet,
Here others undocumented function
Code:
(xstrcase "adesu") ; => "ADESU"
(vmon) ; Virtual Memory On ... Release 10 ???
; Function Notes
(_ver) ; Returns AutoLISP build number (?).
(report) ; Inroduced in R12/DOS; never worked in Windows.
(vmon) ; Discontinued. Once used to enable virtual memory
; still there for compatibility, but does nothing.
(xstrcase) ; An international-friendly version of (strcase).
; From thomas.krueger (AUGI)
(fnsplitl) ; fnsplitl is undocumented. The function splits the path:
; (fnsplitl (strcat(getvar "dwgprefix")(getvar "DWGname")))
; -first entry is the directory
; -second entry the filename
; -third entry the fileextension
Quote:
Originally Posted by kennet.sjoberg
Great Thomas, do you have more undocumented candy ?
: ) Happy Computing !
kennet