TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: AVCAD on May 18, 2018, 03:05:23 PM

Title: Help with a Block Search program
Post by: AVCAD on May 18, 2018, 03:05:23 PM
HI, I am looking for a way to search a directory full of blocks from a UI that pops up in Autocad. really just something super simple like a a dcl that pops up with a search box type in a text string have it list what it finds in a different box, then have that selectable and inserted into the drawing

I haven't coded in along time so any help would be great!

Thanks in advance!
Title: Re: Help with a Block Search program
Post by: AVCAD on May 18, 2018, 07:36:45 PM
Here is what i have so far...

I get the DCL to load doesnt do anything though...i am sure my lsp is totally screwed up. Haven't done this in forever

All I want to do is type in the search box and have results populated in the below box.

search is to look in 1 directory and find any file that matches the search box

then i want to select the result i want and hit ok and have it inserted to my drawing...it will be finding blocks

thanks again for any help.
Title: Re: Help with a Block Search program
Post by: ChrisCarlson on May 21, 2018, 08:56:47 AM
The standard insert dialog is not sufficient?
Title: Re: Help with a Block Search program
Post by: AVCAD on May 21, 2018, 03:51:41 PM
Not sure what you mean?

trying to do this in stages...1 problem at a time...

(vl-directory-files "F:/AutoCAD/Blocks" "acad*.dwg")

i can use this to find the names of files but i dont know how to get that result to populate into the list box i have in the dcl

I also dont know how to make the
Code: [Select]
"acad*.dwg") portion of to be the string that is input in to the search box in the dcl

Title: Re: Help with a Block Search program
Post by: roy_043 on May 21, 2018, 04:58:53 PM
Here is a useful tutorial:
http://web2.airmail.net/terrycad/Tutorials/MyDialogs.htm
Title: Re: Help with a Block Search program
Post by: AVCAD on May 21, 2018, 07:54:12 PM
I dont know what i am doing...lol

I can get the program to write to a file, so it will write the names of the files it finds in the directory i am pointing at. How ever i really just want it to find what i am searching for by the userinput in the dcl

at one point i had it actually populating in the results box but now it wont...

Any help would be great, i thought this would be an easy one but seeing as i havent done in like 10+ years...my mind is not what it use to be...