Diesel Directory

Diesel Directory

Anonymous
Not applicable
364 Views
7 Replies
Message 1 of 8

Diesel Directory

Anonymous
Not applicable
Is there a way, possibly Diesel, to put in a field the directory of a file, not the entire path?

Thanks,
David
0 Likes
365 Views
7 Replies
Replies (7)
Message 2 of 8

ska67can
Contributor
Contributor
vba code:
Dim fileLen, foldLen As Variant
Dim foldName As String

fileLen = Len(ThisDrawing.Name)
foldLen = Len(ThisDrawing.FullName)
foldName = Left(ThisDrawing.FullName, foldLen - fileLen)
0 Likes
Message 3 of 8

Anonymous
Not applicable
That works for VBA. But I want to have it be Diesel code within a Field in an Attribute.

David
0 Likes
Message 4 of 8

Anonymous
Not applicable
Well then, why are you in the VBA group? This question should be in plain
Customization.

FWIW, I don't think you are going to find an easy answer, unless you are on
2007 and can use an AutoLISP variable.

--
R. Robert Bell


wrote in message news:5417137@discussion.autodesk.com...
That works for VBA. But I want to have it be Diesel code within a Field in
an Attribute.

David
0 Likes
Message 5 of 8

Anonymous
Not applicable
If you mean just the path to the drawing file,
but not the filename, then you don't need to
use DIESEL, you can use this field expression:

%<\AcVar Filename \f "%fn1">%

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5416810@discussion.autodesk.com...
Is there a way, possibly Diesel, to put in a field the directory of a file, not the entire path?

Thanks,
David
0 Likes
Message 6 of 8

Anonymous
Not applicable
Tony, I think David is looking for "Stuff" in the case of
"C:\Temp\Stuff\Drawing.dwg".

--
R. Robert Bell


"Tony Tanzillo" wrote in message
news:5417767@discussion.autodesk.com...
If you mean just the path to the drawing file,
but not the filename, then you don't need to
use DIESEL, you can use this field expression:

%<\AcVar Filename \f "%fn1">%

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5416810@discussion.autodesk.com...
Is there a way, possibly Diesel, to put in a field the directory of a file,
not the entire path?
0 Likes
Message 7 of 8

Anonymous
Not applicable
Robert,

Thanks for the clarification. That is exactly correct.

I am looking for "Stuff" in the case of "C:\Temp\Stuff\Drawing.dwg".

David
0 Likes
Message 8 of 8

Anonymous
Not applicable
In that case, pure DIESEL will probably not work
for what you need.

You can use a custom drawing property to store
any data you want, updated whenever needed or
appropriate, using LISP reactors or VBA events,
and you can reference that in your field.

I don't recommend using the LispVariable field
type, because LISP is not available in every
context where a field's value may be referenced.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5417901@discussion.autodesk.com...
Robert,

Thanks for the clarification. That is exactly correct.

I am looking for "Stuff" in the case of "C:\Temp\Stuff\Drawing.dwg".

David
0 Likes