how to show file name as dynamic attribute ?

how to show file name as dynamic attribute ?

yairMSKTU
Enthusiast Enthusiast
1,082 Views
5 Replies
Message 1 of 6

how to show file name as dynamic attribute ?

yairMSKTU
Enthusiast
Enthusiast

i know in attdef in the tag if i put some symbols it shows me things like +-  (i think its %%p or something like that) or date or whatever.

what are the sybols for the file name (including extension) and for the layer name ?

 

i did before but i forgot how i did it...

0 Likes
1,083 Views
5 Replies
Replies (5)
Message 2 of 6

AVCPlugins
Advisor
Advisor

You need to remember that fields are used to substitute the values of the properties of drawing objects.

 


Plugins for AutoCAD
A>V>C>
AppStore | Facebook | Twitter | YouTube | Blog
0 Likes
Message 3 of 6

yairMSKTU
Enthusiast
Enthusiast

@AVCPlugins wrote:

You need to remember that fields are used to substitute the values of the properties of drawing objects.

 



i can use it for whatever i want...    but you havent really answered my question...

0 Likes
Message 4 of 6

AVCPlugins
Advisor
Advisor

If you are interested in the field-code for extracting the filename, then it is like this: %<\AcVar Filename \f "%fn7">%


Plugins for AutoCAD
A>V>C>
AppStore | Facebook | Twitter | YouTube | Blog
0 Likes
Message 5 of 6

paullimapa
Mentor
Mentor

Here's the one for current layer:

%<\AcVar clayer \f "%tc1">%


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 6

Michiel.Valcke
Advisor
Advisor

If you want to add a field (like the filename) to an attribute you have to set the attribute as 'preset'.  You can add a field while making the attribute or you can do it afterwards with the command BATTMAN (right click your preset text and choose the option insert field - this works for almost any kind of text in AutoCAD)

MichielValcke_0-1657532531800.png

You can find the Field expression for your field in the bottom of the Field dialogbox

MichielValcke_1-1657532658893.png

When you insert the block with the attribute in a drawing the filename will be displayed in the attribute.

MichielValcke_2-1657532748631.png


EDIT: as was pointed out to me by @cadffm the preset option is not necessary, you can just use a default and add a field. I have a habit of always using the preset with default values so AutoCAD will not prompt me to fill them in.

0 Likes