• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

search for a text in multiple designs

  • Thread starter Thread starter pertengineering
  • Start date Start date

pertengineering

Guest
Bye.
I would like to share with you this small utility I wrote.
The purpose is to search for a text within multiple designs, without opening them.
I tested it with autocad 2012 64.
I gave him the command ex_f (extended find).


the form is designed as follows:form.webpa button for running the program,one for exit,a cry where to view the results,two check box.
the idea is that you write the text content to be searched in the textbox under "search" and you press find.
at this point the classic explores resources to select dwg files in which to search for the text.
in the grid are displayed the names of the file where the text was found and the occurrences ("number of times").


for the two check boxes, the first "use last sel" serves to bypass the request of where to search and use the selection of the previous dwg files.
The second is looking for the text on dwg already opened in autocad.
(There's no monkey-proof control on this side (example use last sel. to the first execution of the program .. )
if you double-click on the grid opens the corresponding design.


I developed it with vb.net 2010 express (it's free downloadable from microsoft) + ad-hoc plugin (idem from the autodesk site. )
the plugin provides a "mycommands" module in which you can add a command that will be made available in the autocad session.
I'll explain.
once finished our project and compiled its "executable" (effectively it's a .dll file extension)
we will have to load in autocad with the command netload + name dll and the above comendo will be available by autocad.
I'll train you the project, in bin/release there's the dll to load.


read the list before running the program, I made it available to share what little I know.
It's a small vademecum on how to interact with autocad entities.
Consider that I am not a professional programmer, responsible for any damages that the sw can give you... is for educational purposes.
 
hi pertengineering, I uploaded the utility by following your directions, but appeared in the text window (f2) some type errors:
impossible to charge the assembly. error details:
system.io.fileloadexception: impossible to upload the file or the assembly file :///c:\ ......\cercatext\autocad vb plug-in1\bin\release\cercatext.dll' or any of its dependencies. unsupported operation. (except for hresult: 0x80131515) .............
system.notsupportedexception: ................................... etc. etc. etc.
Can you tell me if I have to do more steps to use the application?
I have already made other .dlls with vb.net but I have never happened any kind of errors like this.
I used autocad 2012 on windows 7 - 64 bit.
 
hi ale and thank you for trying my utility.
I can't understand the reason for the error because we all use it here... then I searched on the web and it seems to be a protection due to the fact that the file was downloaded from the internet (so considered "at risk")
try to take a look at this post:http://blogs.msdn.com/b/brada/archi...ported-exception-from-hresult-0x80131515.aspxI hope you can get around the problem, let me know.
Sergio
hi pertengineering, I uploaded the utility by following your directions, but appeared in the text window (f2) some type errors:
impossible to charge the assembly. error details:
system.io.fileloadexception: impossible to upload the file or the assembly file :///c:\ ......\cercatext\autocad vb plug-in1\bin\release\cercatext.dll' or any of its dependencies. unsupported operation. (except for hresult: 0x80131515) .............
system.notsupportedexception: ................................... etc. etc. etc.
Can you tell me if I have to do more steps to use the application?
I have already made other .dlls with vb.net but I have never happened any kind of errors like this.
I used autocad 2012 on windows 7 - 64 bit.
 
unrecognized to me.
I did debug and did not find references acmgd.dll and acdbmgd.dll, but I provided reassign.
after that these errors remained:
Undefined 'document'. (bc30002) - file module1.vbUndefined 'documentcollection'. (bc30002) file module1.vb- necessary a reference to the assembly 'accoremgd, version=19.0.0.0, culture=neutral, publickeytoken=null' containing the base class autodesk.autocad.applicationservices.core. application'. add one to the project. (bc30007) file module1.vbUndefined 'document'. (bc30002) file module1.vbUndefined 'commandclass' type. (bc30002) - mycommands- type 'autodesk.autocad.runtime.commandmethod' undefined. (bc30002) Mycommands
I then added the reference shortemgd.dll indicated above missing and only remains this error:
102 'open' is not a member of 'autodesk.autocad.applicationservices.documentcollection'. (bc30456) - file module1.vb
 
:confused:
i attach you other pictures and a new .dll (without substantial changes)
Besides, the only thing that comes to mind is that you are using 2013 (the utility developed it with 2012) : I read that there are "incompatible" between the two environments;
the thing would support the other debugging errors you mentioned.
Hi.
Sergio
 

Attachments

in autocad 2013 the problem persists.I tried on another pc with 2012, the mask opens, but after selecting the file with find appears an error. this is the error report generated:the application does not support debug jit.further information is given at the bottom of the message.[Bleep] [Bleep] [Bleep] [Bleep]autodesk.autocad.runtime.exception: enotimplementedyet in autodesk.autocad.databaseservices.database.readdwgfile(string filename, fileshare filesharing, boolean allowcpconversion, string password) in cercatext.common.opendb(string dove) in c:\users\*****\documents\visual studio 2010\projects\cercatext\autocad vb plug-in1\module1.vb:riga 41 in cercatext.find_frm.bt_find_click(object sender, eventargs e) in c:\users\*****\documents\visual studio 2010\projects\cercatext\autocad vb plug-in1\form2.vb:riga 48 in system.windows.forms.control.onclick(eventargs e) in system.windows.forms.button.onclick(eventargs e) in system.windows.forms.button.onmouseup(mouseeventargs mevent) in system.windows.forms.control.wmmouseup(message& m, mousebuttons button, int32 clicks) in system.windows.forms.control.wndproc(message& m) in system.windows.forms.buttonbase.wndproc(message& m) in system.windows.forms.button.wndproc(message& m) in system.windows.forms.control.controlnativewindow.onmessage(message& m) in system.windows.forms.control.controlnativewindow.wndproc(message& m) in system.windows.forms.nativewindow.callback(intptr hwnd, int32 msg, intptr wparam, intptr lparam).....
*********** debug jit ****************the application does not support debug jitof windows form. for more information, contact the authorof the application.
 
First of all thank you for the time you dedicate me.

for 2013 there is little to do: the dlls are different and I should also rewrite other craps that I have here.


For the other problem, I'm putting a debug version where I put a try/catch + the dwg reading procedure instead of being readwrite (I don't know why I used it since I just have to read) is just read.
Secondly, I did so that the programme does not continue until the end of the dwg reading.
I've read it a bit around here, but here unfortunately, the problem doesn't happen and I'm going to get you to "cavia."
If this works out, I'll send you the springs.
 

Attachments

First of all thank you for the time you dedicate me.

for 2013 there is little to do: the dlls are different and I should also rewrite other craps that I have here.


For the other problem, I'm putting a debug version where I put a try/catch + the dwg reading procedure instead of being readwrite (I don't know why I used it since I just have to read) is just read.
Secondly, I did so that the programme does not continue until the end of the dwg reading.
I've read it a bit around here, but here unfortunately, the problem doesn't happen and I'm going to get you to "cavia."
If this works out, I'll send you the springs.
on 2012.
It works.
a small bug I think: If I insert texts all ok, if I insert as numbers search characters, the program will find double the numbers present.
 
I connect with delay to vs. discussion of the day, I read the suggestion of pertengineering, on file zip > right button > property > cancel block.
the utility in this way works, ... it works well without any problem as indicated at the beginning of the discussion.
congratulations pertengineering for the work you have done, useful and interesting.

in these days I am trying autocad 2013, I also realized that the .dll made with 2012 is not good, I have to deepen but it seems that it is necessary to install everything again; also the autocad plug-in.
it is not very incorrect, already vb.net is an obstacle to overcome if you then put yourself autodesk!
Bye.
 
...in these days I am trying autocad 2013, I also realized that the .dll made with 2012 is not good, I have to deepen but it seems that it is necessary to install everything again; also the autocad plug-in.
it is not very incorrect, already vb.net is an obstacle to overcome if you then put yourself autodesk!
Bye.
and with 2014 there was an additional change? ?
 
I connect with delay to vs. discussion of the day, I read the suggestion of pertengineering, on file zip > right button > property > cancel block.
the utility in this way works, ... it works well without any problem as indicated at the beginning of the discussion.
congratulations pertengineering for the work you have done, useful and interesting.

in these days I am trying autocad 2013, I also realized that the .dll made with 2012 is not good, I have to deepen but it seems that it is necessary to install everything again; also the autocad plug-in.
it is not very incorrect, already vb.net is an obstacle to overcome if you then put yourself autodesk!
Bye.
Thank you for your compliments.
for the autocad I agree 100%; by breaking a spear in their favor it must be admitted that it is a very complex sw in which research and development can be found in front of the blind alleys that touches to settle.. . .
and with 2014 there was an additional change? ?
I believe that autodesk immetta annual updates "light" and triennial "strong".
13 is strong, so 14 should be like 13.
ps. Now I see the story of numbers, thank you again, then the correct version.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top