Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
.NET
»
Topic:
Name of a drawing (Autocad 2011)
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Name of a drawing (Autocad 2011) (Read 1609 times)
0 Members and 1 Guest are viewing this topic.
latour_g
Newt
Posts: 184
Name of a drawing (Autocad 2011)
«
on:
January 28, 2013, 11:35:57 AM »
Hi,
Is there a way to get only the name of a drawing without having the full path ? Sound easy but I've been searching for quite a while on this..
Thank you !!
«
Last Edit: January 28, 2013, 11:41:21 AM by latour_g
»
Logged
mohnston
Bull Frog
Posts: 305
CAD Programmer
WWW
Re: Name of a drawing (Autocad 2011)
«
Reply #1 on:
January 28, 2013, 11:50:08 AM »
Use the System.IO.FileInfo object.
Logged
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions
BlackBox
King Gator
Posts: 3770
Re: Name of a drawing (Autocad 2011)
«
Reply #2 on:
January 28, 2013, 12:10:58 PM »
Consider the
System.IO.Path.GetFileName()
Method:
Code - C#:
[Select]
string
docNameOnly
=
Path
.
GetFileName
(
doc
.
Name
)
;
Logged
"How we think determines what we do, and what we do determines what we get."
latour_g
Newt
Posts: 184
Re: Name of a drawing (Autocad 2011)
«
Reply #3 on:
January 28, 2013, 03:48:17 PM »
Perfect ! Thank you mohnston and RenderMan !
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
.NET
»
Topic:
Name of a drawing (Autocad 2011)