Print Page | Close Window

Diesel Expression

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=10955
Printed Date: 22.Apr.2026 at 14:50


Topic: Diesel Expression
Posted By: oksijen
Subject: Diesel Expression
Date Posted: 02.Feb.2015 at 20:24
Hello,
AutoCAD file name (diesel expression) I wrote with. However, after the file name (.dwg) I want to hide the extension. Can you help? Thank you.

$(substr,$(getvar,DWGNAME),4,8)



Replies:
Posted By: Kent Cooper
Date Posted: 03.Feb.2015 at 15:15
If you mean that you want the drawing name by itself, without the .dwg filetype extension, here is a way to do it in AutoLISP [I'm not versed in Diesel enough to be confident of expressing it correctly, so I hope you can convert it]:
 
(substr (getvar 'dwgname) 1 (- (strlen (getvar 'dwgname)) 4))
 
If you do that in an initial unsaved drawing, it returns:
"Drawing1"


Posted By: oksijen
Date Posted: 03.Feb.2015 at 22:48
Thank you Kent Cooper,



Print Page | Close Window