Jump to content

Recommended Posts

Posted

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?

Posted

I found my answer. Using vl-filename-base will give me the result I'm looking for

Posted

You can also use the fnsplitl function:

_$ (fnsplitl "C:\\test.txt")
("C:\\" "test" ".txt")

 

  • Like 1

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