PDA

View Full Version : Insert filename into macro?



metron4
2010-10-22, 10:51 PM
I am building a macro that changes the lineweight of xref layers. The file names of the xrefs begin with the same filename as the file they are referenced into.

Main file: CWR A123.dwg
Xreffed file: CWR A123 Plan.dwg

I would like to insert the filename into the macro to filter out other project names so only the similar named xref layers change.

^C^C_LAYER;LW;0.70;* Plan|T-FIBER,* Plan|T-COPPER;;

* = filename

I can only think of two options:

1. Use the filename system variable (dwgname) somehow, although it must strip out the .dwg extension.

2. Call up the field code we use in our title blocks that inserts the file name and strips out the .dwg extension (%<\AcVar Filename \f "%tc1%fn2">%).

Thanks,

Rob

RobertB
2010-10-28, 05:33 PM
^C^C_LAYER;LW;0.70;(strcat (vl-filename-base (getvar 'DwgName)) " Plan|T-FIBER," (vl-filename-base (getvar 'DwgName)) " Plan|T-COPPER");;

metron4
2011-03-07, 09:59 PM
Thanks! That's what I was looking for.