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?
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
Solved by ronjonp. Go to Solution.
Solved by pbejse. Go to Solution.
If you need a vanilla variant using substr works like so:
(substr (setq s "Drawing1.dwg") 1 (- (strlen s) 4))