Community
AutoCAD LT Forum
Welcome to Autodesk’s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Diesel Script to Count Files By Name

5 REPLIES 5
Reply
Message 1 of 6
evan.sjoberg
600 Views, 5 Replies

Diesel Script to Count Files By Name

To clarify i don't do a lot of this type of script, i've just done sql and other such stuff like html and php, here's my problem, 

 

I have a naming schemelike so,

 

FA-01.dwg

FA-02.dwg

FA-03.dwg

 

and the border on my projects has the FA-# in a specific box which i display with the diesel expression "$(substr,$(getvar,dwgname),1,5)"

 

then theres a sheet label, like so:

Sheet #a of #b,

 

for #a i have "$(substr,$(getvar,dwgname),5,1,$(-,$(strlen,$(getvar,dwgname)) ,1))" which i can esily edit to include a 1 or 3 digit FA-#

 

but for #b i'm at a loss, i need a script that will count all the files in the dwg's root directory beginning with 'FA-' for for #b and i have no idea how to go about that, or if it's possible

 

 

the reason i'm going for the dynamic border labels is that my boss likes to copy and rename reusable files like charts and device diagrams into new project folders when he gives me a new project, which it's pretty handy when it automatically updates some of the feilds as it makes it easier on me and leaves fewer things to miss.

 

any ideas? is this even possible?

 

also, i'm using Autocad LT 2010 if it matters

5 REPLIES 5
Message 2 of 6
pendean
in reply to: evan.sjoberg

Not an option in LT.
Message 3 of 6
steven-g
in reply to: evan.sjoberg

I could be wrong about this, because I have never used it, but I think this is one of the reasons to use Sheet Sets.

Message 4 of 6
evan.sjoberg
in reply to: evan.sjoberg

well that's too bad, anyone know any other method for a similar result, the sheet set thing would have been great but i don't think my ancient broken autocad supports much in that area,  thanks for the replies, guys

Message 5 of 6
steven-g
in reply to: evan.sjoberg

Sheets sets were introduced in Autocad 2005, you could possibly create a file tracking program in excel using VBA to get a count of drawings, use a table in Autocad to read the data from excel and then get a field to read the value in the table, but I think sheet sets would be quicker and easier to learn.

Message 6 of 6
pendean
in reply to: evan.sjoberg

Full AutoCAD and some custom Lisp routines using DOSLIB if you want to spend the money and time looking for the solution.

SheetSets in LT started in 2010 version and higher I think.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost