jonathann3891 Posted April 13, 2021 Posted April 13, 2021 Is it possible to strip the file extension (.dwg) of a selected file using the method I have detailed below? Here I am selecting a block and storing the block name in appdata. (defun c:ttt (/) (setq PileType (getfiled "Select Pile Drawing" "Z:\\ECI CAD\\AutoCAD\\PileDriver\\Pile Data\\" "dwg" 8)) (setcfg "AppData/PileDriver/Pile_Type" PileType) (princ) ) Here I am recalling the name of the block stored in appdata. (defun c:foo (/) (setq PileType (getcfg "AppData/PileDriver/Pile_Type")) (setq bname (??)) ) Is it possible to strip the file extension (.dwg) from PileType and set it as bname? Quote
jonathann3891 Posted April 13, 2021 Author Posted April 13, 2021 I found my answer. Using vl-filename-base will give me the result I'm looking for Quote
Lee Mac Posted April 14, 2021 Posted April 14, 2021 You can also use the fnsplitl function: _$ (fnsplitl "C:\\test.txt") ("C:\\" "test" ".txt") 1 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.