The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Hurricane for AutoCAD
 General Discussion
 Count of files found
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

witz
Starting Member

USA
4 Posts

Posted - March 22 2005 :  10:39:25 AM  Show Profile  Visit witz's Homepage  Reply with Quote
I would like to get a count of files(parts) found containing certain text. Such as doing a text search and log, I can get a list of the files, (which are our parts), but how can I get a count of these files, their are many parts to our machines.

I am doing a search for the number of parts made with SS, or Delrin. Which can be found doing the search text and log, but other than counting the number of files in .txt file manually, I have not been able to figure out how to get the total number.

Any assistance would be greatly appreciated, Thanks. Love the program. Oh yeah - Has anyone heard or know if this would work with Inventor, or something like this for Inventor?

Thanks again.

Witz

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - March 22 2005 :  11:27:21 AM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
On the later releases the SEARCH & LOG outputs a LST file. But even if you aren't running the latest version you should be able to paste the following into the OUTPUT FIELD:

$HUR_PATH$DATA/$USER$-TextLog.lst

After the script is complete there will be a nice little FILELIST sitting there for you. Once you double click on it the QUEUE will be loaded and the FILE COUNT appears in the lower left corner.

Hope this helps!

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Admin
Administrator



652 Posts

Posted - March 22 2005 :  11:53:42 AM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hi witz,

A few more quick ideas, short of writing some lisp or a VBA routine...

(BTW I've looked online for some lisp routines, and it looks like there are plenty to count BLOCKS, but none that I could find that count occurence of text). (I see a need )

1) You can open the file in Excel (or rename the txt file to csv and double-click for it to auto-open in Excel), and then your row numbers will indicate how many files have the part.

2) You could load the txt file into a text editor like http://www.editpad.com/ (or similar), many text editors will display which "line number" you are on (bottom left hand corner in EditPad).

(I like Miksteele's method the best though )

Regards,
Bill

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - March 22 2005 :  12:22:29 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
I was going to mention the EDITPAD program too... it's the best TXT editor I ever run into!

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

witz
Starting Member

USA
4 Posts

Posted - March 22 2005 :  12:28:59 PM  Show Profile  Visit witz's Homepage  Reply with Quote
Thanks for the look see, (lower left), that should work fine.

Witz
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - March 22 2005 :  1:28:47 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
$HUR_PATH$DATA/$USER$-TextLog.lst is one of the great uses for TAGS.

If you use Project Tags you can get a little more detail. Actually... you'd be able to run multiple projects all in one script but you'd get a separate filelist for each project.

$HUR_PATH$DATA/$PROJECTTAG1$-TextLog.lst

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

witz
Starting Member

USA
4 Posts

Posted - March 22 2005 :  3:45:25 PM  Show Profile  Visit witz's Homepage  Reply with Quote
Thanks Mike - I got the tags to work, but cannot get the search to overwrite the file, it only keeps adding new file names tot he .lst file. Or .txt file. What ever one I create, I have to open it and then delete the contents to do another search. I have even checked the overwrite box, but it does not seem to do anything.

Thanks, Witz

Witz
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - March 22 2005 :  4:03:27 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
You're right... Well, the OVERWRITE and APPEND options you see in the WIZARD are only referring to the SCRIPT within Hurricane. It allows you to append several search and log tasks.

The output file is controlled in the LOG_TEXT.LSP file. The LSP actually opens the output file (if it exists) for appending. The LSP can probably be tweaked... however I'm not sure I'd be successful. I don't have that much any experience writing LISP. I have had to modify quite a few however. If I'm successful, I'll post here...

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - March 22 2005 :  4:22:25 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
I don't think I can tweak the LSP. I could tell you to throw a TIME TAG in the output field such as:

$HUR_PATH$DATA/$TIME_24$-$USER$-TextLog.lst

But that particular TAG format uses a : as a separator and this will not work in a filename.

If the tag used a different separator that was filename friendly... would it be useable... would it fix your problem or just create a new one for you?

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

n/a
deleted

112 Posts

Posted - March 22 2005 :  4:30:17 PM  Show Profile  Reply with Quote
Are we talking about:

Lines 53 & 54 of LOG_TEXT.LSP?


; OPEN file for appending as F1.
(setq F1 (open OUTPUT_FILE "a"))


If so, change 54 as shown below and give it a try: (a for append; w for write).:


(setq F1 (open OUTPUT_FILE "w"))

Steve Bubendorf
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - March 22 2005 :  4:40:45 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
Bingo

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Admin
Administrator



652 Posts

Posted - March 22 2005 :  4:42:26 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hi Guys...

I think what will happen when you change the "a" to a "w" is that you will only ever get 1 line in your file, as the file will keep getting overwritten each and every time you call the lisp.
(I haven't tried it, but I'm pretty sure this will be the result, let me know if I am full of it!)

I'd pick a TAG that would change each time you run the script... hmmm... maybe this calls for another TAG to be added...

Some sort of "unique" incrementer, that just increments every time the "CREATE AND RUN" button is pressed.

The other option is to add a "KILL [filename]" META Command, but I think that could be dangerous!

Regards,
Bill

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

n/a
deleted

112 Posts

Posted - March 22 2005 :  4:45:52 PM  Show Profile  Reply with Quote
I think you're right, Bill. I wasn't following the topic in detail. I should have realized that it was being used in a script and being called afresh for each drawing. I'm sorry for misleading all of you.

Steve Bubendorf
Go to Top of Page

witz
Starting Member

USA
4 Posts

Posted - March 22 2005 :  4:49:04 PM  Show Profile  Visit witz's Homepage  Reply with Quote
I'll just make sure to empty the contents of the file before running, that would seem to be the easiest.

Thanks again Witz.

Witz
Go to Top of Page

Admin
Administrator



652 Posts

Posted - March 22 2005 :  4:49:42 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
NO PROBLEM sbubendorf!

Don't hesitate to post your ideas... your comment might apply to something unrelated... it's all still valuable!!

Regards,
Bill


Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - March 22 2005 :  4:51:40 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
awe man... you got my hopes up.

If you go the tag route I think the ones I'd use would be date and time. I can already use the individual month, day and year tags... the date tag however

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - March 22 2005 :  4:57:05 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
yeah witz... Don't hesitate to post your ideas. You never know. I at least learned how to change an "a" into a "w" with this one.

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - March 22 2005 :  5:55:41 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
WITZ... you wrote:
quote:
I'll just make sure to empty the contents of the file before running, that would seem to be the easiest.


It sounds like you are using the QUEUE to count your files...It may be even easier to just delete the filelist (your output file) prior to running your script. No need to open it.

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.47 seconds. Snitz Forums 2000